Commit bbb06345 authored by Anshul Maheshwari's avatar Anshul Maheshwari Committed by Michael Niedermayer

ffmpeg_opt: Creating new data stream for output format context

Signed-off-by: 's avatarAnshul Maheshwari <er.anshul.maheshwari@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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8123e19e
...@@ -1935,7 +1935,15 @@ static int open_output_file(OptionsContext *o, const char *filename) ...@@ -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 { } else {
for (i = 0; i < o->nb_stream_maps; i++) { for (i = 0; i < o->nb_stream_maps; i++) {
StreamMap *map = &o->stream_maps[i]; StreamMap *map = &o->stream_maps[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment