mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-11 06:58:18 +00:00
fftools/ffmpeg: deprecate specifying a sync stream with -map
It has not had any effect whatsoever for over 10 years.
This commit is contained in:
parent
49123dd058
commit
fee249b30a
@ -1411,14 +1411,12 @@ Set the size of the canvas used to render subtitles.
|
|||||||
@section Advanced options
|
@section Advanced options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?][,@var{sync_file_id}[:@var{stream_specifier}]] | @var{[linklabel]} (@emph{output})
|
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output})
|
||||||
|
|
||||||
Designate one or more input streams as a source for the output file. Each input
|
Designate one or more input streams as a source for the output file. Each input
|
||||||
stream is identified by the input file index @var{input_file_id} and
|
stream is identified by the input file index @var{input_file_id} and
|
||||||
the input stream index @var{input_stream_id} within the input
|
the input stream index @var{input_stream_id} within the input
|
||||||
file. Both indices start at 0. If specified,
|
file. Both indices start at 0.
|
||||||
@var{sync_file_id}:@var{stream_specifier} sets which input stream
|
|
||||||
is used as a presentation sync reference.
|
|
||||||
|
|
||||||
The first @code{-map} option on the command line specifies the
|
The first @code{-map} option on the command line specifies the
|
||||||
source for output stream 0, the second @code{-map} option specifies
|
source for output stream 0, the second @code{-map} option specifies
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
// deprecated features
|
// deprecated features
|
||||||
#define FFMPEG_OPT_PSNR 1
|
#define FFMPEG_OPT_PSNR 1
|
||||||
#define FFMPEG_OPT_MAP_CHANNEL 1
|
#define FFMPEG_OPT_MAP_CHANNEL 1
|
||||||
|
#define FFMPEG_OPT_MAP_SYNC 1
|
||||||
|
|
||||||
enum VideoSyncMethod {
|
enum VideoSyncMethod {
|
||||||
VSYNC_AUTO = -1,
|
VSYNC_AUTO = -1,
|
||||||
@ -81,8 +82,6 @@ typedef struct StreamMap {
|
|||||||
int disabled; /* 1 is this mapping is disabled by a negative map */
|
int disabled; /* 1 is this mapping is disabled by a negative map */
|
||||||
int file_index;
|
int file_index;
|
||||||
int stream_index;
|
int stream_index;
|
||||||
int sync_file_index;
|
|
||||||
int sync_stream_index;
|
|
||||||
char *linklabel; /* name of an output link, for mapping lavfi outputs */
|
char *linklabel; /* name of an output link, for mapping lavfi outputs */
|
||||||
} StreamMap;
|
} StreamMap;
|
||||||
|
|
||||||
|
@ -415,9 +415,10 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
|||||||
OptionsContext *o = optctx;
|
OptionsContext *o = optctx;
|
||||||
StreamMap *m = NULL;
|
StreamMap *m = NULL;
|
||||||
int i, negative = 0, file_idx, disabled = 0;
|
int i, negative = 0, file_idx, disabled = 0;
|
||||||
int sync_file_idx = -1, sync_stream_idx = 0;
|
#if FFMPEG_OPT_MAP_SYNC
|
||||||
char *p, *sync;
|
char *sync;
|
||||||
char *map;
|
#endif
|
||||||
|
char *map, *p;
|
||||||
char *allow_unused;
|
char *allow_unused;
|
||||||
|
|
||||||
if (*arg == '-') {
|
if (*arg == '-') {
|
||||||
@ -428,33 +429,13 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
|||||||
if (!map)
|
if (!map)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
#if FFMPEG_OPT_MAP_SYNC
|
||||||
/* parse sync stream first, just pick first matching stream */
|
/* parse sync stream first, just pick first matching stream */
|
||||||
if (sync = strchr(map, ',')) {
|
if (sync = strchr(map, ',')) {
|
||||||
*sync = 0;
|
*sync = 0;
|
||||||
sync_file_idx = strtol(sync + 1, &sync, 0);
|
av_log(NULL, AV_LOG_WARNING, "Specifying a sync stream is deprecated and has no effect\n");
|
||||||
if (sync_file_idx >= nb_input_files || sync_file_idx < 0) {
|
|
||||||
av_log(NULL, AV_LOG_FATAL, "Invalid sync file index: %d.\n", sync_file_idx);
|
|
||||||
exit_program(1);
|
|
||||||
}
|
|
||||||
if (*sync)
|
|
||||||
sync++;
|
|
||||||
for (i = 0; i < input_files[sync_file_idx]->nb_streams; i++)
|
|
||||||
if (check_stream_specifier(input_files[sync_file_idx]->ctx,
|
|
||||||
input_files[sync_file_idx]->ctx->streams[i], sync) == 1) {
|
|
||||||
sync_stream_idx = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i == input_files[sync_file_idx]->nb_streams) {
|
|
||||||
av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s does not "
|
|
||||||
"match any streams.\n", arg);
|
|
||||||
exit_program(1);
|
|
||||||
}
|
|
||||||
if (input_streams[input_files[sync_file_idx]->ist_index + sync_stream_idx]->user_set_discard == AVDISCARD_ALL) {
|
|
||||||
av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s matches a disabled input "
|
|
||||||
"stream.\n", arg);
|
|
||||||
exit_program(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (map[0] == '[') {
|
if (map[0] == '[') {
|
||||||
@ -499,14 +480,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
|||||||
|
|
||||||
m->file_index = file_idx;
|
m->file_index = file_idx;
|
||||||
m->stream_index = i;
|
m->stream_index = i;
|
||||||
|
|
||||||
if (sync_file_idx >= 0) {
|
|
||||||
m->sync_file_index = sync_file_idx;
|
|
||||||
m->sync_stream_index = sync_stream_idx;
|
|
||||||
} else {
|
|
||||||
m->sync_file_index = file_idx;
|
|
||||||
m->sync_stream_index = i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user