[vlc-commits] demux/image: seek back to 0 on probe failure

Rémi Denis-Courmont git at videolan.org
Sun Mar 3 10:25:12 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar  3 10:47:05 2019 +0200| [61a2abe1c8e8ffb8d242db85ef13f692cd56615e] | committer: Rémi Denis-Courmont

demux/image: seek back to 0 on probe failure

This is the same as 11874bc592eb32f8f89075fe59294dc2d0115058, but
within the (combined) image demuxer. Alternatively, we would have to
write one submodule and callback for each image format.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=61a2abe1c8e8ffb8d242db85ef13f692cd56615e
---

 modules/demux/image.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/image.c b/modules/demux/image.c
index b7a424b861..00ed643eb7 100644
--- a/modules/demux/image.c
+++ b/modules/demux/image.c
@@ -661,7 +661,10 @@ static vlc_fourcc_t Detect(stream_t *s)
             if (img->detect(s))
                 return img->codec;
 
-            /* detect callbacks can invalidate the current peek buffer */
+            if (vlc_stream_Seek(s, 0))
+               return 0;
+
+            /* Seeking invalidates the current peek buffer */
             peek_size = 0;
             continue;
         }



More information about the vlc-commits mailing list