[FFmpeg-cvslog] ffmpeg_opt: Creating new data stream for output format context

Anshul Maheshwari git at videolan.org
Sun Feb 15 12:54:05 CET 2015


ffmpeg | branch: master | Anshul Maheshwari <er.anshul.maheshwari at gmail.com> | Sun Feb 15 15:42:01 2015 +0530| [bbb06345851480d1fc7d1f8438d7505fe159030e] | committer: Michael Niedermayer

ffmpeg_opt: Creating new data stream for output format context

Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari at gmail.com>

if input codec Id match with expected data stream of output format context
then only new stream with same codec id is created.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg_opt.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 56b882e..f208ac5 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1935,7 +1935,15 @@ static int open_output_file(OptionsContext *o, const char *filename)
                     }
                 }
         }
-        /* do something with data? */
+        /* Data only if codec id match */
+        if (!o->data_disable ) {
+            enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_DATA);
+            for (i = 0; codec_id != AV_CODEC_ID_NONE && i < nb_input_streams; i++) {
+                if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_DATA
+                    && input_streams[i]->st->codec->codec_id == codec_id )
+                    new_data_stream(o, oc, i);
+            }
+        }
     } else {
         for (i = 0; i < o->nb_stream_maps; i++) {
             StreamMap *map = &o->stream_maps[i];



More information about the ffmpeg-cvslog mailing list