aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-01 18:02:04 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-01 18:02:04 +0100
commitd9cc6bb4324821853d56a44bb6b1bc6172ebeb6e (patch)
tree6d000808470c0ecd45a96be7d2fcfe1e01e2e8ac /ffmpeg.c
parent3e1951e8f4a615cde2e65117f2dbd38bac6e57b6 (diff)
downloadffmpeg-d9cc6bb4324821853d56a44bb6b1bc6172ebeb6e.tar.gz
Support ffmpeg -dn to disable copying data streams.
Fixes ticket #647.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index c507a2200e..e81936de8c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3243,6 +3243,8 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
st->discard= video_discard;
break;
case AVMEDIA_TYPE_DATA:
+ if (o->data_disable)
+ st->discard= AVDISCARD_ALL;
break;
case AVMEDIA_TYPE_SUBTITLE:
if(!ist->dec)
@@ -4060,6 +4062,8 @@ static void opt_output_file(void *optctx, const char *filename)
continue;
if(o-> video_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
continue;
+ if(o-> data_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_DATA)
+ continue;
switch (ist->st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc); break;
@@ -4764,6 +4768,7 @@ static const OptionDef options[] = {
{ "fpre", HAS_ARG | OPT_EXPERT| OPT_FUNC2, {(void*)opt_preset}, "set options from indicated preset file", "filename" },
/* data codec support */
{ "dcodec", HAS_ARG | OPT_DATA | OPT_FUNC2, {(void*)opt_data_codec}, "force data codec ('copy' to copy stream)", "codec" },
+ { "dn", OPT_BOOL | OPT_VIDEO | OPT_OFFSET, {.off = OFFSET(data_disable)}, "disable data" },
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ NULL, },