[FFmpeg-cvslog] ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec

Michael Niedermayer git at videolan.org
Fri Nov 14 19:28:31 CET 2014


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Aug  2 03:29:42 2014 +0200| [bcb10b99f4e86692b02e3ce38a89e21874b77dc9] | committer: Michael Niedermayer

ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec

Fixes part of ticket2236

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 956f4087c6eb717e31f3b92fe03fd56a3747eccf)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg_opt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 286f973..8b2b83e 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1681,7 +1681,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
         /* pick the "best" stream of each type */
 
         /* video: highest resolution */
-        if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
+        if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
             int area = 0, idx = -1;
             int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
             for (i = 0; i < nb_input_streams; i++) {
@@ -1703,7 +1703,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
         }
 
         /* audio: most channels */
-        if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
+        if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
             int channels = 0, idx = -1;
             for (i = 0; i < nb_input_streams; i++) {
                 ist = input_streams[i];



More information about the ffmpeg-cvslog mailing list