From: Anton Khirnov <anton@khirnov.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 27/27] fftools/ffmpeg_opt: reindent Date: Sat, 23 Jul 2022 16:09:52 +0200 Message-ID: <20220723140952.31814-27-anton@khirnov.net> (raw) In-Reply-To: <20220723140952.31814-1-anton@khirnov.net> --- fftools/ffmpeg_opt.c | 140 +++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 672ac87b3e..d7049069f4 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2635,80 +2635,80 @@ static void map_auto_data(OutputFile *of, AVFormatContext *oc, static void map_manual(OutputFile *of, AVFormatContext *oc, OptionsContext *o, const StreamMap *map) { - InputStream *ist; - OutputStream *ost; - - if (map->disabled) - return; - - if (map->linklabel) { - FilterGraph *fg; - OutputFilter *ofilter = NULL; - int j, k; - - for (j = 0; j < nb_filtergraphs; j++) { - fg = filtergraphs[j]; - for (k = 0; k < fg->nb_outputs; k++) { - AVFilterInOut *out = fg->outputs[k]->out_tmp; - if (out && !strcmp(out->name, map->linklabel)) { - ofilter = fg->outputs[k]; - goto loop_end; - } - } + InputStream *ist; + OutputStream *ost; + + if (map->disabled) + return; + + if (map->linklabel) { + FilterGraph *fg; + OutputFilter *ofilter = NULL; + int j, k; + + for (j = 0; j < nb_filtergraphs; j++) { + fg = filtergraphs[j]; + for (k = 0; k < fg->nb_outputs; k++) { + AVFilterInOut *out = fg->outputs[k]->out_tmp; + if (out && !strcmp(out->name, map->linklabel)) { + ofilter = fg->outputs[k]; + goto loop_end; } + } + } loop_end: - if (!ofilter) { - av_log(NULL, AV_LOG_FATAL, "Output with label '%s' does not exist " - "in any defined filter graph, or was already used elsewhere.\n", map->linklabel); - exit_program(1); - } - init_output_filter(ofilter, o, oc); - } else { - int src_idx = input_files[map->file_index]->ist_index + map->stream_index; + if (!ofilter) { + av_log(NULL, AV_LOG_FATAL, "Output with label '%s' does not exist " + "in any defined filter graph, or was already used elsewhere.\n", map->linklabel); + exit_program(1); + } + init_output_filter(ofilter, o, oc); + } else { + int src_idx = input_files[map->file_index]->ist_index + map->stream_index; - ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index]; - if (ist->user_set_discard == AVDISCARD_ALL) { - av_log(NULL, AV_LOG_FATAL, "Stream #%d:%d is disabled and cannot be mapped.\n", - map->file_index, map->stream_index); - exit_program(1); - } - if(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) - return; - if(o-> audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) - return; - if(o-> video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) - return; - if(o-> data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA) - return; - - ost = NULL; - switch (ist->st->codecpar->codec_type) { - case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_DATA: ost = new_data_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break; - case AVMEDIA_TYPE_UNKNOWN: - if (copy_unknown_streams) { - ost = new_unknown_stream (o, oc, src_idx); - break; - } - default: - av_log(NULL, ignore_unknown_streams ? AV_LOG_WARNING : AV_LOG_FATAL, - "Cannot map stream #%d:%d - unsupported type.\n", - map->file_index, map->stream_index); - if (!ignore_unknown_streams) { - av_log(NULL, AV_LOG_FATAL, - "If you want unsupported types ignored instead " - "of failing, please use the -ignore_unknown option\n" - "If you want them copied, please use -copy_unknown\n"); - exit_program(1); - } - } - if (ost) - ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index - + map->sync_stream_index]; + ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index]; + if (ist->user_set_discard == AVDISCARD_ALL) { + av_log(NULL, AV_LOG_FATAL, "Stream #%d:%d is disabled and cannot be mapped.\n", + map->file_index, map->stream_index); + exit_program(1); + } + if(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) + return; + if(o-> audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) + return; + if(o-> video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) + return; + if(o-> data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA) + return; + + ost = NULL; + switch (ist->st->codecpar->codec_type) { + case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break; + case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break; + case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream (o, oc, src_idx); break; + case AVMEDIA_TYPE_DATA: ost = new_data_stream (o, oc, src_idx); break; + case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break; + case AVMEDIA_TYPE_UNKNOWN: + if (copy_unknown_streams) { + ost = new_unknown_stream (o, oc, src_idx); + break; + } + default: + av_log(NULL, ignore_unknown_streams ? AV_LOG_WARNING : AV_LOG_FATAL, + "Cannot map stream #%d:%d - unsupported type.\n", + map->file_index, map->stream_index); + if (!ignore_unknown_streams) { + av_log(NULL, AV_LOG_FATAL, + "If you want unsupported types ignored instead " + "of failing, please use the -ignore_unknown option\n" + "If you want them copied, please use -copy_unknown\n"); + exit_program(1); } + } + if (ost) + ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index + + map->sync_stream_index]; + } } static int open_output_file(OptionsContext *o, const char *filename) -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-07-23 14:12 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-23 14:09 [FFmpeg-devel] [PATCH 01/27] fftools/ffmpeg: replace AVFrame.pkt_duration with duration Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 02/27] fftools/ffmpeg: stop accessing the encoder context unnecessarily Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 03/27] fftools/ffmpeg: remove an unnecessary avcodec_close() call Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 04/27] fftools/ffmpeg_filter: remove unused function argument Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 05/27] fftools/ffmpeg_filter: do not pass the entire AVCodecContext to choose_pixel_fmt() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 06/27] fftools/ffmpeg: drop the -vol option Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 07/27] fftools/ffmpeg: drop OutputStream.ref_par Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 08/27] fftools/ffmpeg: do not use the encoder context for streamcopy Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 09/27] fftools/ffmpeg: deprecate -psnr Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 10/27] fftools/ffmpeg: stop allocating an encoder context when not encoding Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 11/27] fftools/ffmpeg_opt: drop a redundant assignment Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 12/27] fftools/ffmpeg: drop unused hwaccel variables Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 13/27] fftools/ffmpeg: move guess_input_channel_layout() to ffmpeg_opt.c Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 14/27] fftools/ffmpeg: deprecate the -map_channel option Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 15/27] fftools/ffmpeg_filter: drop a block commented out since 2012 Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 16/27] fftools/ffmpeg_mux: move some functions closer to their only callers Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 17/27] fftools/ffmpeg: do not log to the decoder context Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 18/27] fftools/ffmpeg_opt: factor auto-mapping video out of open_output_file() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 19/27] fftools/ffmpeg_opt: reduce indentation in map_auto_video() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 20/27] fftools/ffmpeg_opt: factor auto-mapping audio out of open_output_file() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 21/27] fftools/ffmpeg_opt: reduce indentation in map_auto_audio() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 22/27] fftools/ffmpeg_opt: factor auto-mapping subtitles out of open_output_file() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 23/27] fftools/ffmpeg_opt: reduce indentation in map_auto_subtitle() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 24/27] fftools/ffmpeg_opt: factor auto-mapping data streams out of open_output_file() Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 25/27] fftools/ffmpeg_opt: reindent Anton Khirnov 2022-07-23 14:09 ` [FFmpeg-devel] [PATCH 26/27] fftools/ffmpeg_opt: factor manually mapping streams out of open_output_file() Anton Khirnov 2022-07-23 14:09 ` Anton Khirnov [this message] 2022-07-23 15:21 ` [FFmpeg-devel] [PATCH 01/27] fftools/ffmpeg: replace AVFrame.pkt_duration with duration Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220723140952.31814-27-anton@khirnov.net \ --to=anton@khirnov.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git