| @@ -71,13 +71,10 @@ static int choose_encoder(const OptionsContext *o, AVFormatContext *s, · 70 unmodified lines |
| 71 | 71 | { |
| 72 | 72 | enum AVMediaType type = ost->type; |
| 73 | 73 | const char *codec_name = NULL; |
| 74 | | − int ret; |
| 75 | 74 | |
| 76 | 75 | *enc = NULL; |
| 77 | 76 | |
| 78 | | − ret = opt_match_per_stream_str(ost, &o->codec_names, s, ost->st, &codec_name); |
| 79 | | − if (ret < 0) |
| 80 | | − return ret; |
| 77 | + opt_match_per_stream_str(ost, &o->codec_names, s, ost->st, &codec_name); |
| 81 | 78 | |
| 82 | 79 | if (type != AVMEDIA_TYPE_VIDEO && |
| 83 | 80 | type != AVMEDIA_TYPE_AUDIO && |
| @@ -419,17 +416,12 @@ static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, · 335 unmodified lines |
| 419 | 416 | OutputStream *ost, char **dst) |
| 420 | 417 | { |
| 421 | 418 | const char *filters = NULL; |
| 422 | | − int ret; |
| 423 | 419 | #if FFMPEG_OPT_FILTER_SCRIPT |
| 424 | 420 | const char *filters_script = NULL; |
| 425 | 421 | |
| 426 | | − ret = opt_match_per_stream_str(ost, &o->filter_scripts, oc, ost->st, &filters_script); |
| 427 | | − if (ret < 0) |
| 428 | | − return ret; |
| 422 | + opt_match_per_stream_str(ost, &o->filter_scripts, oc, ost->st, &filters_script); |
| 429 | 423 | #endif |
| 430 | | − ret = opt_match_per_stream_str(ost, &o->filters, oc, ost->st, &filters); |
| 431 | | − if (ret < 0) |
| 432 | | − return ret; |
| 424 | + opt_match_per_stream_str(ost, &o->filters, oc, ost->st, &filters); |
| 433 | 425 | |
| 434 | 426 | if (!ost->enc) { |
| 435 | 427 | if ( |
| @@ -599,17 +591,13 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 163 unmodified lines |
| 599 | 591 | |
| 600 | 592 | st = ost->st; |
| 601 | 593 | |
| 602 | | − ret = opt_match_per_stream_str(ost, &o->frame_rates, oc, st, &frame_rate); |
| 603 | | − if (ret < 0) |
| 604 | | − return ret; |
| 594 | + opt_match_per_stream_str(ost, &o->frame_rates, oc, st, &frame_rate); |
| 605 | 595 | if (frame_rate && av_parse_video_rate(&ost->frame_rate, frame_rate) < 0) { |
| 606 | 596 | av_log(ost, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate); |
| 607 | 597 | return AVERROR(EINVAL); |
| 608 | 598 | } |
| 609 | 599 | |
| 610 | | − ret = opt_match_per_stream_str(ost, &o->max_frame_rates, oc, st, &max_frame_rate); |
| 611 | | − if (ret < 0) |
| 612 | | − return ret; |
| 600 | + opt_match_per_stream_str(ost, &o->max_frame_rates, oc, st, &max_frame_rate); |
| 613 | 601 | if (max_frame_rate && av_parse_video_rate(&ost->max_frame_rate, max_frame_rate) < 0) { |
| 614 | 602 | av_log(ost, AV_LOG_FATAL, "Invalid maximum framerate value: %s\n", max_frame_rate); |
| 615 | 603 | return AVERROR(EINVAL); |
| @@ -620,9 +608,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 4 unmodified lines |
| 620 | 608 | return AVERROR(EINVAL); |
| 621 | 609 | } |
| 622 | 610 | |
| 623 | | − ret = opt_match_per_stream_str(ost, &o->frame_aspect_ratios, oc, st, &frame_aspect_ratio); |
| 624 | | − if (ret < 0) |
| 625 | | − return ret; |
| 611 | + opt_match_per_stream_str(ost, &o->frame_aspect_ratios, oc, st, &frame_aspect_ratio); |
| 626 | 612 | if (frame_aspect_ratio) { |
| 627 | 613 | AVRational q; |
| 628 | 614 | if (av_parse_ratio(&q, frame_aspect_ratio, 255, 0, NULL) < 0 || |
| @@ -643,9 +629,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 14 unmodified lines |
| 643 | 629 | int do_pass = 0; |
| 644 | 630 | int i; |
| 645 | 631 | |
| 646 | | − ret = opt_match_per_stream_str(ost, &o->frame_sizes, oc, st, &frame_size); |
| 647 | | − if (ret < 0) |
| 648 | | − return ret; |
| 632 | + opt_match_per_stream_str(ost, &o->frame_sizes, oc, st, &frame_size); |
| 649 | 633 | if (frame_size) { |
| 650 | 634 | ret = av_parse_video_size(&video_enc->width, &video_enc->height, frame_size); |
| 651 | 635 | if (ret < 0) { |
| @@ -654,9 +638,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 2 unmodified lines |
| 654 | 638 | } |
| 655 | 639 | } |
| 656 | 640 | |
| 657 | | − ret = opt_match_per_stream_str(ost, &o->frame_pix_fmts, oc, st, &frame_pix_fmt); |
| 658 | | − if (ret < 0) |
| 659 | | − return ret; |
| 641 | + opt_match_per_stream_str(ost, &o->frame_pix_fmts, oc, st, &frame_pix_fmt); |
| 660 | 642 | if (frame_pix_fmt && *frame_pix_fmt == '+') { |
| 661 | 643 | *keep_pix_fmt = 1; |
| 662 | 644 | if (!*++frame_pix_fmt) |
| @@ -668,9 +650,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 5 unmodified lines |
| 668 | 650 | return AVERROR(EINVAL); |
| 669 | 651 | } |
| 670 | 652 | |
| 671 | | − ret = opt_match_per_stream_str(ost, &o->intra_matrices, oc, st, &intra_matrix); |
| 672 | | − if (ret < 0) |
| 673 | | − return ret; |
| 653 | + opt_match_per_stream_str(ost, &o->intra_matrices, oc, st, &intra_matrix); |
| 674 | 654 | if (intra_matrix) { |
| 675 | 655 | if (!(video_enc->intra_matrix = av_mallocz(sizeof(*video_enc->intra_matrix) * 64))) |
| 676 | 656 | return AVERROR(ENOMEM); |
| @@ -679,9 +659,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 2 unmodified lines |
| 679 | 659 | if (ret < 0) |
| 680 | 660 | return ret; |
| 681 | 661 | } |
| 682 | | − ret = opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix); |
| 683 | | − if (ret < 0) |
| 684 | | − return ret; |
| 662 | + opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix); |
| 685 | 663 | if (chroma_intra_matrix) { |
| 686 | 664 | uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64); |
| 687 | 665 | if (!p) |
| @@ -691,9 +669,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 3 unmodified lines |
| 691 | 669 | if (ret < 0) |
| 692 | 670 | return ret; |
| 693 | 671 | } |
| 694 | | − ret = opt_match_per_stream_str(ost, &o->inter_matrices, oc, st, &inter_matrix); |
| 695 | | − if (ret < 0) |
| 696 | | − return ret; |
| 672 | + opt_match_per_stream_str(ost, &o->inter_matrices, oc, st, &inter_matrix); |
| 697 | 673 | if (inter_matrix) { |
| 698 | 674 | if (!(video_enc->inter_matrix = av_mallocz(sizeof(*video_enc->inter_matrix) * 64))) |
| 699 | 675 | return AVERROR(ENOMEM); |
| @@ -702,9 +678,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 2 unmodified lines |
| 702 | 678 | return ret; |
| 703 | 679 | } |
| 704 | 680 | |
| 705 | | − ret = opt_match_per_stream_str(ost, &o->rc_overrides, oc, st, &p); |
| 706 | | − if (ret < 0) |
| 707 | | − return ret; |
| 681 | + opt_match_per_stream_str(ost, &o->rc_overrides, oc, st, &p); |
| 708 | 682 | for (i = 0; p; i++) { |
| 709 | 683 | int start, end, q; |
| 710 | 684 | int e = sscanf(p, "%d,%d,%d", &start, &end, &q); |
| @@ -735,9 +709,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 24 unmodified lines |
| 735 | 709 | video_enc->rc_override_count = i; |
| 736 | 710 | |
| 737 | 711 | /* two pass mode */ |
| 738 | | − ret = opt_match_per_stream_int(ost, &o->pass, oc, st, &do_pass); |
| 739 | | − if (ret < 0) |
| 740 | | − return ret; |
| 712 | + opt_match_per_stream_int(ost, &o->pass, oc, st, &do_pass); |
| 741 | 713 | if (do_pass) { |
| 742 | 714 | if (do_pass & 1) |
| 743 | 715 | video_enc->flags |= AV_CODEC_FLAG_PASS1; |
| @@ -745,9 +717,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 1 unmodified line |
| 745 | 717 | video_enc->flags |= AV_CODEC_FLAG_PASS2; |
| 746 | 718 | } |
| 747 | 719 | |
| 748 | | − ret = opt_match_per_stream_str(ost, &o->passlogfiles, oc, st, &ost->logfile_prefix); |
| 749 | | − if (ret < 0) |
| 750 | | − return ret; |
| 720 | + opt_match_per_stream_str(ost, &o->passlogfiles, oc, st, &ost->logfile_prefix); |
| 751 | 721 | if (ost->logfile_prefix && |
| 752 | 722 | !(ost->logfile_prefix = av_strdup(ost->logfile_prefix))) |
| 753 | 723 | return AVERROR(ENOMEM); |
| @@ -794,15 +764,11 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 40 unmodified lines |
| 794 | 764 | } |
| 795 | 765 | } |
| 796 | 766 | |
| 797 | | − ret = opt_match_per_stream_int(ost, &o->force_fps, oc, st, &ost->force_fps); |
| 798 | | − if (ret < 0) |
| 799 | | − return ret; |
| 767 | + opt_match_per_stream_int(ost, &o->force_fps, oc, st, &ost->force_fps); |
| 800 | 768 | |
| 801 | 769 | #if FFMPEG_OPT_TOP |
| 802 | 770 | ost->top_field_first = -1; |
| 803 | | − ret = opt_match_per_stream_int(ost, &o->top_field_first, oc, st, &ost->top_field_first); |
| 804 | | − if (ret < 0) |
| 805 | | − return ret; |
| 771 | + opt_match_per_stream_int(ost, &o->top_field_first, oc, st, &ost->top_field_first); |
| 806 | 772 | if (ost->top_field_first >= 0) |
| 807 | 773 | av_log(ost, AV_LOG_WARNING, "-top is deprecated, use the setfield filter instead\n"); |
| 808 | 774 | #endif |
| @@ -812,9 +778,7 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, · 3 unmodified lines |
| 812 | 778 | #else |
| 813 | 779 | *vsync_method = VSYNC_AUTO; |
| 814 | 780 | #endif |
| 815 | | − ret = opt_match_per_stream_str(ost, &o->fps_mode, oc, st, &fps_mode); |
| 816 | | − if (ret < 0) |
| 817 | | − return ret; |
| 781 | + opt_match_per_stream_str(ost, &o->fps_mode, oc, st, &fps_mode); |
| 818 | 782 | if (fps_mode) { |
| 819 | 783 | ret = parse_and_set_vsync(fps_mode, vsync_method, ost->file->index, ost->index, 0); |
| 820 | 784 | if (ret < 0) |
| @@ -872,40 +836,28 @@ static int new_stream_audio(Muxer *mux, const OptionsContext *o, · 51 unmodified lines |
| 872 | 836 | int channels = 0; |
| 873 | 837 | const char *layout = NULL; |
| 874 | 838 | const char *sample_fmt = NULL; |
| 875 | | − int ret; |
| 876 | 839 | |
| 877 | | − ret = opt_match_per_stream_int(ost, &o->audio_channels, oc, st, &channels); |
| 878 | | − if (ret < 0) |
| 879 | | − return ret; |
| 840 | + opt_match_per_stream_int(ost, &o->audio_channels, oc, st, &channels); |
| 880 | 841 | if (channels) { |
| 881 | 842 | audio_enc->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; |
| 882 | 843 | audio_enc->ch_layout.nb_channels = channels; |
| 883 | 844 | } |
| 884 | 845 | |
| 885 | | − ret = opt_match_per_stream_str(ost, &o->audio_ch_layouts, oc, st, &layout); |
| 886 | | − if (ret < 0) |
| 887 | | − return ret; |
| 846 | + opt_match_per_stream_str(ost, &o->audio_ch_layouts, oc, st, &layout); |
| 888 | 847 | if (layout && av_channel_layout_from_string(&audio_enc->ch_layout, layout) < 0) { |
| 889 | 848 | av_log(ost, AV_LOG_FATAL, "Unknown channel layout: %s\n", layout); |
| 890 | 849 | return AVERROR(EINVAL); |
| 891 | 850 | } |
| 892 | 851 | |
| 893 | | − ret = opt_match_per_stream_str(ost, &o->sample_fmts, oc, st, &sample_fmt); |
| 894 | | − if (ret < 0) |
| 895 | | − return ret; |
| 852 | + opt_match_per_stream_str(ost, &o->sample_fmts, oc, st, &sample_fmt); |
| 896 | 853 | if (sample_fmt && |
| 897 | 854 | (audio_enc->sample_fmt = av_get_sample_fmt(sample_fmt)) == AV_SAMPLE_FMT_NONE) { |
| 898 | 855 | av_log(ost, AV_LOG_FATAL, "Invalid sample format '%s'\n", sample_fmt); |
| 899 | 856 | return AVERROR(EINVAL); |
| 900 | 857 | } |
| 901 | 858 | |
| 902 | | − ret = opt_match_per_stream_int(ost, &o->audio_sample_rate, oc, st, &audio_enc->sample_rate); |
| 903 | | − if (ret < 0) |
| 904 | | − return ret; |
| 905 | | − |
| 906 | | − ret = opt_match_per_stream_str(ost, &o->apad, oc, st, &ms->apad); |
| 907 | | − if (ret < 0) |
| 908 | | − return ret; |
| 859 | + opt_match_per_stream_int(ost, &o->audio_sample_rate, oc, st, &audio_enc->sample_rate); |
| 860 | + opt_match_per_stream_str(ost, &o->apad, oc, st, &ms->apad); |
| 909 | 861 | } |
| 910 | 862 | |
| 911 | 863 | return 0; |
| @@ -928,11 +880,8 @@ static int new_stream_subtitle(Muxer *mux, const OptionsContext *o, · 16 unmodified lines |
| 928 | 880 | int input_props = 0, output_props = 0; |
| 929 | 881 | |
| 930 | 882 | const char *frame_size = NULL; |
| 931 | | − int ret; |
| 932 | 883 | |
| 933 | | − ret = opt_match_per_stream_str(ost, &o->frame_sizes, mux->fc, st, &frame_size); |
| 934 | | − if (ret < 0) |
| 935 | | − return ret; |
| 884 | + opt_match_per_stream_str(ost, &o->frame_sizes, mux->fc, st, &frame_size); |
| 936 | 885 | if (frame_size) { |
| 937 | 886 | int ret = av_parse_video_size(&subtitle_enc->width, &subtitle_enc->height, frame_size); |
| 938 | 887 | if (ret < 0) { |
| @@ -1211,13 +1160,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 272 unmodified lines |
| 1211 | 1160 | if (ret < 0) |
| 1212 | 1161 | goto fail; |
| 1213 | 1162 | |
| 1214 | | − ret = opt_match_per_stream_str(ost, &o->presets, oc, st, &preset); |
| 1215 | | − if (ret < 0) |
| 1216 | | − goto fail; |
| 1217 | | − |
| 1218 | | − ret = opt_match_per_stream_int(ost, &o->autoscale, oc, st, &autoscale); |
| 1219 | | − if (ret < 0) |
| 1220 | | − goto fail; |
| 1163 | + opt_match_per_stream_str(ost, &o->presets, oc, st, &preset); |
| 1164 | + opt_match_per_stream_int(ost, &o->autoscale, oc, st, &autoscale); |
| 1221 | 1165 | if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s)))) { |
| 1222 | 1166 | AVBPrint bprint; |
| 1223 | 1167 | av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); |
| @@ -1248,14 +1192,12 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 24 unmodified lines |
| 1248 | 1192 | goto fail; |
| 1249 | 1193 | } |
| 1250 | 1194 | |
| 1251 | | − ret = opt_match_per_stream_str(ost, &o->enc_stats_pre, oc, st, &enc_stats_pre); |
| 1252 | | − if (ret < 0) |
| 1253 | | − goto fail; |
| 1195 | + opt_match_per_stream_str(ost, &o->enc_stats_pre, oc, st, &enc_stats_pre); |
| 1254 | 1196 | if (enc_stats_pre && |
| 1255 | 1197 | (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { |
| 1256 | 1198 | const char *format = "{fidx} {sidx} {n} {t}"; |
| 1257 | 1199 | |
| 1258 | | − ret = opt_match_per_stream_str(ost, &o->enc_stats_pre_fmt, oc, st, &format); |
| 1200 | + opt_match_per_stream_str(ost, &o->enc_stats_pre_fmt, oc, st, &format); |
| 1259 | 1201 | if (ret < 0) |
| 1260 | 1202 | goto fail; |
| 1261 | 1203 | |
| @@ -1264,41 +1206,31 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 2 unmodified lines |
| 1264 | 1206 | goto fail; |
| 1265 | 1207 | } |
| 1266 | 1208 | |
| 1267 | | − ret = opt_match_per_stream_str(ost, &o->enc_stats_post, oc, st, &enc_stats_post); |
| 1268 | | − if (ret < 0) |
| 1269 | | − goto fail; |
| 1209 | + opt_match_per_stream_str(ost, &o->enc_stats_post, oc, st, &enc_stats_post); |
| 1270 | 1210 | if (enc_stats_post && |
| 1271 | 1211 | (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { |
| 1272 | 1212 | const char *format = "{fidx} {sidx} {n} {t}"; |
| 1273 | 1213 | |
| 1274 | | − ret = opt_match_per_stream_str(ost, &o->enc_stats_post_fmt, oc, st, &format); |
| 1275 | | − if (ret < 0) |
| 1276 | | − goto fail; |
| 1214 | + opt_match_per_stream_str(ost, &o->enc_stats_post_fmt, oc, st, &format); |
| 1277 | 1215 | |
| 1278 | 1216 | ret = enc_stats_init(ost, &ost->enc_stats_post, 0, enc_stats_post, format); |
| 1279 | 1217 | if (ret < 0) |
| 1280 | 1218 | goto fail; |
| 1281 | 1219 | } |
| 1282 | 1220 | |
| 1283 | | − ret = opt_match_per_stream_str(ost, &o->mux_stats, oc, st, &mux_stats); |
| 1284 | | − if (ret < 0) |
| 1285 | | − goto fail; |
| 1221 | + opt_match_per_stream_str(ost, &o->mux_stats, oc, st, &mux_stats); |
| 1286 | 1222 | if (mux_stats && |
| 1287 | 1223 | (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { |
| 1288 | 1224 | const char *format = "{fidx} {sidx} {n} {t}"; |
| 1289 | 1225 | |
| 1290 | | − ret = opt_match_per_stream_str(ost, &o->mux_stats_fmt, oc, st, &format); |
| 1291 | | − if (ret < 0) |
| 1292 | | − goto fail; |
| 1226 | + opt_match_per_stream_str(ost, &o->mux_stats_fmt, oc, st, &format); |
| 1293 | 1227 | |
| 1294 | 1228 | ret = enc_stats_init(ost, &ms->stats, 0, mux_stats, format); |
| 1295 | 1229 | if (ret < 0) |
| 1296 | 1230 | goto fail; |
| 1297 | 1231 | } |
| 1298 | 1232 | |
| 1299 | | − ret = opt_match_per_stream_str(ost, &o->enc_time_bases, oc, st, &enc_time_base); |
| 1300 | | − if (ret < 0) |
| 1301 | | − goto fail; |
| 1233 | + opt_match_per_stream_str(ost, &o->enc_time_bases, oc, st, &enc_time_base); |
| 1302 | 1234 | if (enc_time_base && type == AVMEDIA_TYPE_SUBTITLE) |
| 1303 | 1235 | av_log(ost, AV_LOG_WARNING, |
| 1304 | 1236 | "-enc_time_base not supported for subtitles, ignoring\n"); |
| @@ -1361,9 +1293,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 56 unmodified lines |
| 1361 | 1293 | ost->bitexact = !!(ost->enc_ctx->flags & AV_CODEC_FLAG_BITEXACT); |
| 1362 | 1294 | } |
| 1363 | 1295 | |
| 1364 | | − ret = opt_match_per_stream_str(ost, &o->time_bases, oc, st, &time_base); |
| 1365 | | − if (ret < 0) |
| 1366 | | − goto fail; |
| 1296 | + opt_match_per_stream_str(ost, &o->time_bases, oc, st, &time_base); |
| 1367 | 1297 | if (time_base) { |
| 1368 | 1298 | AVRational q; |
| 1369 | 1299 | if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || |
| @@ -1376,9 +1306,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 6 unmodified lines |
| 1376 | 1306 | } |
| 1377 | 1307 | |
| 1378 | 1308 | ms->max_frames = INT64_MAX; |
| 1379 | | − ret = opt_match_per_stream_int64(ost, &o->max_frames, oc, st, &ms->max_frames); |
| 1380 | | − if (ret < 0) |
| 1381 | | − return ret; |
| 1309 | + opt_match_per_stream_int64(ost, &o->max_frames, oc, st, &ms->max_frames); |
| 1382 | 1310 | for (int i = 0; i < o->max_frames.nb_opt; i++) { |
| 1383 | 1311 | char *p = o->max_frames.opt[i].specifier; |
| 1384 | 1312 | if (!*p && type != AVMEDIA_TYPE_VIDEO) { |
| @@ -1388,13 +1316,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 3 unmodified lines |
| 1388 | 1316 | } |
| 1389 | 1317 | |
| 1390 | 1318 | ms->copy_prior_start = -1; |
| 1391 | | − ret = opt_match_per_stream_int(ost, &o->copy_prior_start, oc, st, &ms->copy_prior_start); |
| 1392 | | − if (ret < 0) |
| 1393 | | − goto fail; |
| 1394 | | − |
| 1395 | | − ret = opt_match_per_stream_str(ost, &o->bitstream_filters, oc, st, &bsfs); |
| 1396 | | − if (ret < 0) |
| 1397 | | − goto fail; |
| 1319 | + opt_match_per_stream_int(ost, &o->copy_prior_start, oc, st, &ms->copy_prior_start); |
| 1320 | + opt_match_per_stream_str(ost, &o->bitstream_filters, oc, st, &bsfs); |
| 1398 | 1321 | if (bsfs && *bsfs) { |
| 1399 | 1322 | ret = av_bsf_list_parse_str(bsfs, &ms->bsf_ctx); |
| 1400 | 1323 | if (ret < 0) { |
| @@ -1403,9 +1326,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 2 unmodified lines |
| 1403 | 1326 | } |
| 1404 | 1327 | } |
| 1405 | 1328 | |
| 1406 | | − ret = opt_match_per_stream_str(ost, &o->codec_tags, oc, st, &codec_tag); |
| 1407 | | − if (ret < 0) |
| 1408 | | − goto fail; |
| 1329 | + opt_match_per_stream_str(ost, &o->codec_tags, oc, st, &codec_tag); |
| 1409 | 1330 | if (codec_tag) { |
| 1410 | 1331 | uint32_t tag = strtol(codec_tag, &next, 0); |
| 1411 | 1332 | if (*next) { |
| @@ -1419,9 +1340,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 7 unmodified lines |
| 1419 | 1340 | ost->enc_ctx->codec_tag = tag; |
| 1420 | 1341 | } |
| 1421 | 1342 | |
| 1422 | | − ret = opt_match_per_stream_dbl(ost, &o->qscale, oc, st, &qscale); |
| 1423 | | − if (ret < 0) |
| 1424 | | − return ret; |
| 1343 | + opt_match_per_stream_dbl(ost, &o->qscale, oc, st, &qscale); |
| 1425 | 1344 | if (ost->enc_ctx && qscale >= 0) { |
| 1426 | 1345 | ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE; |
| 1427 | 1346 | ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale; |
| @@ -1431,38 +1350,26 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, · 3 unmodified lines |
| 1431 | 1350 | int max_muxing_queue_size = 128; |
| 1432 | 1351 | int muxing_queue_data_threshold = 50 * 1024 * 1024; |
| 1433 | 1352 | |
| 1434 | | − ret = opt_match_per_stream_int(ost, &o->max_muxing_queue_size, oc, st, |
| 1435 | | − &max_muxing_queue_size); |
| 1436 | | − if (ret < 0) |
| 1437 | | − goto fail; |
| 1438 | | − |
| 1439 | | − ret = opt_match_per_stream_int(ost, &o->muxing_queue_data_threshold, |
| 1440 | | − oc, st, &muxing_queue_data_threshold); |
| 1441 | | − if (ret < 0) |
| 1442 | | − goto fail; |
| 1353 | + opt_match_per_stream_int(ost, &o->max_muxing_queue_size, oc, st, |
| 1354 | + &max_muxing_queue_size); |
| 1355 | + opt_match_per_stream_int(ost, &o->muxing_queue_data_threshold, |
| 1356 | + oc, st, &muxing_queue_data_threshold); |
| 1443 | 1357 | |
| 1444 | 1358 | sch_mux_stream_buffering(mux->sch, mux->sch_idx, ms->sch_idx, |
| 1445 | 1359 | max_muxing_queue_size, muxing_queue_data_threshold); |
| 1446 | 1360 | } |
| 1447 | 1361 | |
| 1448 | | − ret = opt_match_per_stream_int(ost, &o->bits_per_raw_sample, oc, st, |
| 1362 | + opt_match_per_stream_int(ost, &o->bits_per_raw_sample, oc, st, |
| 1449 | 1363 | &ost->bits_per_raw_sample); |
| 1450 | | − if (ret < 0) |
| 1451 | | − goto fail; |
| 1452 | 1364 | |
| 1453 | | − ret = opt_match_per_stream_int(ost, &o->fix_sub_duration_heartbeat, |
| 1454 | | − oc, st, &ost->fix_sub_duration_heartbeat); |
| 1455 | | − if (ret < 0) |
| 1456 | | − goto fail; |
| 1365 | + opt_match_per_stream_int(ost, &o->fix_sub_duration_heartbeat, |
| 1366 | + oc, st, &ost->fix_sub_duration_heartbeat); |
| 1457 | 1367 | |
| 1458 | 1368 | if (oc->oformat->flags & AVFMT_GLOBALHEADER && ost->enc_ctx) |
| 1459 | 1369 | ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; |
| 1460 | 1370 | |
| 1461 | | − ret = opt_match_per_stream_int(ost, &o->copy_initial_nonkeyframes, |
| 1462 | | − oc, st, &ms->copy_initial_nonkeyframes); |
| 1463 | | − if (ret < 0) |
| 1464 | | − goto fail; |
| 1465 | | − |
| 1371 | + opt_match_per_stream_int(ost, &o->copy_initial_nonkeyframes, |
| 1372 | + oc, st, &ms->copy_initial_nonkeyframes); |
| 1466 | 1373 | switch (type) { |
| 1467 | 1374 | case AVMEDIA_TYPE_VIDEO: ret = new_stream_video (mux, o, ost, &keep_pix_fmt, &vsync_method); break; |
| 1468 | 1375 | case AVMEDIA_TYPE_AUDIO: ret = new_stream_audio (mux, o, ost); break; |
| @@ -3036,9 +2943,7 @@ static int set_dispositions(Muxer *mux, const OptionsContext *o) · 1567 unmodified lines |
| 3036 | 2943 | |
| 3037 | 2944 | nb_streams[ost->type + 1]++; |
| 3038 | 2945 | |
| 3039 | | − ret = opt_match_per_stream_str(ost, &o->disposition, ctx, ost->st, &dispositions[i]); |
| 3040 | | − if (ret < 0) |
| 3041 | | − goto finish; |
| 2946 | + opt_match_per_stream_str(ost, &o->disposition, ctx, ost->st, &dispositions[i]); |
| 3042 | 2947 | |
| 3043 | 2948 | have_manual |= !!dispositions[i]; |
| 3044 | 2949 | |
| @@ -3183,12 +3088,9 @@ static int process_forced_keyframes(Muxer *mux, const OptionsContext *o) · 138 unmodified lines |
| 3183 | 3088 | for (int i = 0; i < mux->of.nb_streams; i++) { |
| 3184 | 3089 | OutputStream *ost = mux->of.streams[i]; |
| 3185 | 3090 | const char *forced_keyframes = NULL; |
| 3186 | | − int ret; |
| 3187 | 3091 | |
| 3188 | | − ret = opt_match_per_stream_str(ost, &o->forced_key_frames, |
| 3189 | | − mux->fc, ost->st, &forced_keyframes); |
| 3190 | | − if (ret < 0) |
| 3191 | | − return ret; |
| 3092 | + opt_match_per_stream_str(ost, &o->forced_key_frames, |
| 3093 | + mux->fc, ost->st, &forced_keyframes); |
| 3192 | 3094 | |
| 3193 | 3095 | if (!(ost->type == AVMEDIA_TYPE_VIDEO && |
| 3194 | 3096 | ost->enc_ctx && forced_keyframes)) |