Just a couple notes.

1. This fixes a rather nasty downstream bug:
https://github.com/andrewrk/libgroove/issues/16

2. Here are the relevant libav bug reports:

https://bugzilla.libav.org/show_bug.cgi?id=43

I actually can't duplicate the bug in master any more with the provided
test file. However, I provide another test file in the duplicate bug report:

https://bugzilla.libav.org/show_bug.cgi?id=567

In this one, if you use avplay in master with the provided test file,
seeking to *anywhere* yields these sorts of things (along with glitchy
audio):

[wmav2 @ 0x7f2108004f80] next_block_len_bits 4 out of range
[wmav2 @ 0x7f2108004f80] overflow in spectral RLE, ignoring=0/0
[wmav2 @ 0x7f2108004f80] frame_len overflow 0KB sq=    0B f=0/0

However, I think this is an avplay bug, because downstream I only have this
issue when seeking to 0, not anywhere else.

After this patch, seeking to 0 works in both avplay and downstream. Seeking
anywhere else is still broken in avplay and still works fine downstream.


It's not a perfect fix; the seeking code probably needs to be rewritten.
But I think that it is still an important improvement and should be used
until deeper restructuring is possible.


On Sun, Feb 2, 2014 at 4:25 PM, Andrew Kelley <[email protected]> wrote:

> This is a workaround for the WMA decoder which incorrectly seeks to
> 0 for some streams.
>
> Bug-id: 43
> ---
>  libavformat/asfdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 5b4366e..0505269 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1475,6 +1475,12 @@ static int asf_read_seek(AVFormatContext *s, int
> stream_index,
>              return 0;
>          }
>      }
> +    /* explicitly handle the case of seeking to 0 */
> +    if (pts == 0) {
> +        asf_reset_header(s);
> +        avio_seek(s->pb, s->data_offset, SEEK_SET);
> +        return 0;
> +    }
>      /* no index or seeking by index failed */
>      if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
>          return -1;
> --
> 1.8.3.2
>
>
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to