summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-11-29 18:38:02 +0000
committerMans Rullgard <mans@mansr.com>2011-12-02 18:49:50 +0000
commit150ddbc1482c65b9aac803f011d7fcd734f776ec (patch)
treec6f0fe61229ee732a2625e9f0e9e4c7930fe5e30 /avconv.c
parent5a2e2516456e383575b44545d17c7f5859ca67b9 (diff)
Do not memcpy raw video frames when using null muxer
Commit 035af99 made avconv always call an encoder when using the null muxer. While useful for 2-pass encodes, it inadvertently caused an extra memcpy of raw frames when decoding only. This hack restores the old behaviour when only decoding while allowing use of the null muxer with encoded streams as well. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/avconv.c b/avconv.c
index d6045b7ef4..8842b24599 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1207,7 +1207,8 @@ static void do_video_out(AVFormatContext *s,
av_init_packet(&pkt);
pkt.stream_index= ost->index;
- if (s->oformat->flags & AVFMT_RAWPICTURE) {
+ if (s->oformat->flags & AVFMT_RAWPICTURE &&
+ enc->codec->id == CODEC_ID_RAWVIDEO) {
/* raw pictures are written as AVPicture structure to
avoid any copies. We support temporarily the older
method. */
@@ -1459,7 +1460,7 @@ static void flush_encoders(OutputStream *ost_table, int nb_ostreams)
if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
continue;
- if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
+ if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE) && enc->codec->id == CODEC_ID_RAWVIDEO)
continue;
for(;;) {