Unified · Split
| @@ -99,7 +99,7 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) · 98 unmodified lines | ||
| 99 | 99 | |
| 100 | 100 | MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate) |
| 101 | 101 | |
| 102 | −static AVCodec *find_decoder(AVStream *st, enum AVCodecID codec_id) | |
| 102 | +static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id) | |
| 103 | 103 | { |
| 104 | 104 | if (st->codec->codec) |
| 105 | 105 | return st->codec->codec; |
| @@ -2438,7 +2438,7 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr) · 2332 unmodified lines | ||
| 2438 | 2438 | } |
| 2439 | 2439 | |
| 2440 | 2440 | /* returns 1 or 0 if or if not decoded data was returned, or a negative error */ |
| 2441 | −static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **options) | |
| 2441 | +static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, AVDictionary **options) | |
| 2442 | 2442 | { |
| 2443 | 2443 | const AVCodec *codec; |
| 2444 | 2444 | int got_picture = 1, ret = 0; |
| @@ -2452,7 +2452,7 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option · 7 unmodified lines | ||
| 2452 | 2452 | if (!avcodec_is_open(st->codec) && !st->info->found_decoder) { |
| 2453 | 2453 | AVDictionary *thread_opt = NULL; |
| 2454 | 2454 | |
| 2455 | − codec = find_decoder(st, st->codec->codec_id); | |
| 2455 | + codec = find_decoder(s, st, st->codec->codec_id); | |
| 2456 | 2456 | |
| 2457 | 2457 | if (!codec) { |
| 2458 | 2458 | st->info->found_decoder = -1; |
| @@ -2703,7 +2703,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 244 unmodified lines | ||
| 2703 | 2703 | avcodec_get_name(st->codec->codec_id)); |
| 2704 | 2704 | } |
| 2705 | 2705 | } |
| 2706 | − codec = find_decoder(st, st->codec->codec_id); | |
| 2706 | + codec = find_decoder(ic, st, st->codec->codec_id); | |
| 2707 | 2707 | |
| 2708 | 2708 | /* force thread count to 1 since the h264 decoder will not extract SPS |
| 2709 | 2709 | * and PPS to extradata during multi-threaded decoding */ |
| @@ -2933,7 +2933,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 223 unmodified lines | ||
| 2933 | 2933 | least one frame of codec data, this makes sure the codec initializes |
| 2934 | 2934 | the channel configuration and does not only trust the values from the container. |
| 2935 | 2935 | */ |
| 2936 | − try_decode_frame(st, pkt, (options && i < orig_nb_streams ) ? &options[i] : NULL); | |
| 2936 | + try_decode_frame(ic, st, pkt, (options && i < orig_nb_streams ) ? &options[i] : NULL); | |
| 2937 | 2937 | |
| 2938 | 2938 | st->codec_info_nb_frames++; |
| 2939 | 2939 | count++; |
| @@ -2951,7 +2951,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 11 unmodified lines | ||
| 2951 | 2951 | /* flush the decoders */ |
| 2952 | 2952 | if (st->info->found_decoder == 1) { |
| 2953 | 2953 | do { |
| 2954 | − err = try_decode_frame(st, &empty_pkt, | |
| 2954 | + err = try_decode_frame(ic, st, &empty_pkt, | |
| 2955 | 2955 | (options && i < orig_nb_streams) ? |
| 2956 | 2956 | &options[i] : NULL); |
| 2957 | 2957 | } while (err > 0 && !has_codec_parameters(st, NULL)); |
| @@ -3154,7 +3154,7 @@ int av_find_best_stream(AVFormatContext *ic, · 196 unmodified lines | ||
| 3154 | 3154 | if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED)) |
| 3155 | 3155 | continue; |
| 3156 | 3156 | if (decoder_ret) { |
| 3157 | − decoder = find_decoder(st, st->codec->codec_id); | |
| 3157 | + decoder = find_decoder(ic, st, st->codec->codec_id); | |
| 3158 | 3158 | if (!decoder) { |
| 3159 | 3159 | if (ret < 0) |
| 3160 | 3160 | ret = AVERROR_DECODER_NOT_FOUND; |