diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-20 13:13:09 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-05-11 07:32:37 +0200 |
commit | 3fd62c6e247468d792ce8f1d3c458017d1ea9eb5 (patch) | |
tree | 711c7e99727124e3ce247deb1b2e7954b43f9429 /ffmpeg.c | |
parent | 2b95602e93226bd269676b0edcda5322b5be8444 (diff) | |
download | ffmpeg-3fd62c6e247468d792ce8f1d3c458017d1ea9eb5.tar.gz |
ffmpeg: call pre_process_video_frame() only if decoding is needed
In output_packet(), move the pre_process_video_frame() call inside the
if (ist->decoding_needed) { } block. This way
pre_process_video_frame() is not called when stream-copy has been
selected.
Also simplify.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1428,7 +1428,7 @@ static int output_packet(AVInputStream *ist, int ist_index, int ret, i; int got_output; AVFrame picture; - void *buffer_to_free; + void *buffer_to_free = NULL; static unsigned int samples_size= 0; AVSubtitle subtitle, *subtitle_to_free; int64_t pkt_pts = AV_NOPTS_VALUE; @@ -1530,6 +1530,8 @@ static int output_packet(AVInputStream *ist, int ist_index, ist->st->codec->time_base.den; } avpkt.size = 0; + buffer_to_free = NULL; + pre_process_video_frame(ist, (AVPicture *)&picture, &buffer_to_free); break; case AVMEDIA_TYPE_SUBTITLE: ret = avcodec_decode_subtitle2(ist->st->codec, @@ -1564,12 +1566,6 @@ static int output_packet(AVInputStream *ist, int ist_index, avpkt.size = 0; } - buffer_to_free = NULL; - if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { - pre_process_video_frame(ist, (AVPicture *)&picture, - &buffer_to_free); - } - #if CONFIG_AVFILTER if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ist->input_video_filter) { AVRational sar; |