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