]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mtv.c
Use ff_packet_free_side_data instead of duplicating it.
[ffmpeg] / libavformat / mtv.c
index 4252309a6eeb01ebc2556ed142d46b2a82a43d5b..7237963ef39f426d3463347d9c95e7724539cabc 100644 (file)
@@ -53,7 +53,7 @@ typedef struct MTVDemuxContext {
 static int mtv_probe(AVProbeData *p)
 {
     /* Magic is 'AMV' */
-    if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
+    if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
         return 0;
 
     /* Check for nonzero in bpp and (width|height) header fields */
@@ -112,10 +112,12 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
     avio_skip(pb, 4);
     audio_subsegments = avio_rl16(pb);
-    if(!audio_subsegments){
-        av_log(s, AV_LOG_ERROR, "audio_subsegments is 0\n");
-        return AVERROR(EINVAL);
+
+    if (audio_subsegments == 0) {
+        av_log_ask_for_sample(s, "MTV files without audio are not supported\n");
+        return AVERROR_INVALIDDATA;
     }
+
     mtv->full_segment_size =
         audio_subsegments * (MTV_AUDIO_PADDING_SIZE + MTV_ASUBCHUNK_DATA_SIZE) +
         mtv->img_segment_size;