[FFmpeg-devel,2/3] lavf/matroskadec: fallback to generic seeking if resyncing fails while seeking

Submitted by Rodger Combs on Dec. 9, 2017, 2:24 a.m.

Details

Message ID 20171209022430.85954-2-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs Dec. 9, 2017, 2:24 a.m.
---
 libavformat/matroskadec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b51f67af00..944ed795d5 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3532,8 +3532,12 @@  static int matroska_read_seek(AVFormatContext *s, int stream_index,
             int64_t pos = avio_tell(matroska->ctx->pb);
             matroska_clear_queue(matroska);
             if ((ret = matroska_parse_cluster(matroska)) < 0) {
-                if ((ret == AVERROR_EOF) || matroska_resync(matroska, pos) < 0)
+                if (ret == AVERROR_EOF) {
                     break;
+                } else if(matroska_resync(matroska, pos) < 0) {
+                    index = -1;
+                    break;
+                }
             }
         }
     }