]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/format.c
avformat/hlsenc: Add some comments to make the code easier to read
[ffmpeg] / libavformat / format.c
index 231efcf4dbac7c52454d6afc9aec061451d6840e..233fbd7c30ff860c15c1430d90b0a1a3e72c4d15 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/atomic.h"
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/opt.h"
 
 #include "avio_internal.h"
 #include "avformat.h"
 #include "id3v2.h"
 #include "internal.h"
-#include "libavutil/atomic.h"
-#include "libavutil/bprint.h"
-#include "libavutil/opt.h"
+
 
 /**
  * @file
@@ -257,6 +257,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
     uint8_t *mime_type;
     int ret = 0, probe_size, buf_offset = 0;
     int score = 0;
+    int ret2;
 
     if (!max_probe_size)
         max_probe_size = PROBE_BUF_MAX;
@@ -331,8 +332,9 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
 
 fail:
     /* Rewind. Reuse probe buffer to avoid seeking. */
+    ret2 = ffio_rewind_with_probe_data(pb, &buf, buf_offset);
     if (ret >= 0)
-        ret = ffio_rewind_with_probe_data(pb, &buf, buf_offset);
+        ret = ret2;
 
 #if FF_API_PROBE_MIME
     av_free(pd.mime_type);