[FFmpeg-devel] [PATCH 1/1] opus_silk: reset midonly flag after skipping LBRR

2022-09-23 Thread Tristan Matthews
Fix suggested by Mark Harris. Fixes ticket #9890

Simplified after feedback from Anton Khirnov.
---
 libavcodec/opus_silk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 8523b55ada..f9d67f4fb3 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -833,6 +833,8 @@ int ff_silk_decode_superframe(SilkContext *s, 
OpusRangeCoder *rc,
 int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1;
 silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1);
 }
+
+s->midonly = 0;
 }
 
 for (i = 0; i < nb_frames; i++) {
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/1] opus_silk: reset midonly flag after skipping LBRR

2022-09-15 Thread Tristan Matthews
On Wed, Aug 31, 2022 at 2:32 PM Tristan Matthews  wrote:
>
> Fix suggested by Mark Harris. Fixes ticket #9890
> ---
>  libavcodec/opus_silk.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
> index 8523b55ada..0b4438388e 100644
> --- a/libavcodec/opus_silk.c
> +++ b/libavcodec/opus_silk.c
> @@ -828,11 +828,16 @@ int ff_silk_decode_superframe(SilkContext *s, 
> OpusRangeCoder *rc,
>
>  /* decode the LBRR frames */
>  for (i = 0; i < nb_frames; i++) {
> +int skipped = 0;
>  for (j = 0; j < coded_channels; j++)
>  if (redundancy[j] & (1 << i)) {
>  int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 
> 1;
>  silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 
> 1);
> +skipped = 1;
>  }
> +/* reset midonly if needed */
> +if (skipped)
> +s->midonly = 0;
>  }
>
>  for (i = 0; i < nb_frames; i++) {
> --
> 2.34.1
>

Ping
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/1] opus_silk: reset midonly flag after skipping LBRR

2022-08-31 Thread Tristan Matthews
Fix suggested by Mark Harris. Fixes ticket #9890
---
 libavcodec/opus_silk.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 8523b55ada..0b4438388e 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -828,11 +828,16 @@ int ff_silk_decode_superframe(SilkContext *s, 
OpusRangeCoder *rc,
 
 /* decode the LBRR frames */
 for (i = 0; i < nb_frames; i++) {
+int skipped = 0;
 for (j = 0; j < coded_channels; j++)
 if (redundancy[j] & (1 << i)) {
 int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1;
 silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1);
+skipped = 1;
 }
+/* reset midonly if needed */
+if (skipped)
+s->midonly = 0;
 }
 
 for (i = 0; i < nb_frames; i++) {
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".