[FFmpeg-cvslog] avconv: factorize common code in transcode_init()

Anton Khirnov git at videolan.org
Mon Oct 10 03:59:50 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Sep 27 08:16:26 2011 +0200| [11fdb7e197f0cb8016df9668fc2050bee25e4955] | committer: Anton Khirnov

avconv: factorize common code in transcode_init()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11fdb7e197f0cb8016df9668fc2050bee25e4955
---

 avconv.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/avconv.c b/avconv.c
index c418b7c..058c0ee 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2059,6 +2059,8 @@ static int transcode_init(OutputFile *output_files,
         } else {
             if (!ost->enc)
                 ost->enc = avcodec_find_encoder(ost->st->codec->codec_id);
+            ist->decoding_needed = 1;
+            ost->encoding_needed = 1;
             switch(codec->codec_type) {
             case AVMEDIA_TYPE_AUDIO:
                 ost->fifo= av_fifo_alloc(1024);
@@ -2083,8 +2085,6 @@ static int transcode_init(OutputFile *output_files,
                     codec->channel_layout = 0;
                 ost->audio_resample = codec->sample_rate != icodec->sample_rate || audio_sync_method > 1;
                 icodec->request_channels = codec->channels;
-                ist->decoding_needed = 1;
-                ost->encoding_needed = 1;
                 ost->resample_sample_fmt  = icodec->sample_fmt;
                 ost->resample_sample_rate = icodec->sample_rate;
                 ost->resample_channels    = icodec->channels;
@@ -2134,8 +2134,6 @@ static int transcode_init(OutputFile *output_files,
                 ost->resample_height = icodec->height;
                 ost->resample_width  = icodec->width;
                 ost->resample_pix_fmt= icodec->pix_fmt;
-                ost->encoding_needed = 1;
-                ist->decoding_needed = 1;
 
                 if (!ost->frame_rate.num)
                     ost->frame_rate = ist->st->r_frame_rate.num ? ist->st->r_frame_rate : (AVRational){25,1};
@@ -2153,8 +2151,6 @@ static int transcode_init(OutputFile *output_files,
 #endif
                 break;
             case AVMEDIA_TYPE_SUBTITLE:
-                ost->encoding_needed = 1;
-                ist->decoding_needed = 1;
                 break;
             default:
                 abort();



More information about the ffmpeg-cvslog mailing list