]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Aug 2015 00:16:31 +0000 (02:16 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Aug 2015 01:37:09 +0000 (03:37 +0200)
The null muxer has AVFMT_RAWPICTURE set but can be fed with non-raw material

related to Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ffmpeg.c

index 4bd5f6026741136ef883b5a2a09fe7bd1921116a..530b3aa73e63b178d5c895c4097a313f9eaa8369 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1880,7 +1880,9 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
     }
     av_copy_packet_side_data(&opkt, pkt);
 
-    if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
+    if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+        ost->st->codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
+        (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
         /* store AVPicture in AVPacket, as expected by the output format */
         int ret = avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
         if (ret < 0) {