History

avformat/utils: pass AVFormatContext to find_decoder()

Michael Niedermayer committed 13 years ago

Commit f4aec341 parent af6e2321 file · +7 −7Browse files

Unified · Split

libavformat/utils.c+7−7
@@ -99,7 +99,7 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) · 98 unmodified lines
9999
100100 MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
101101
102−static AVCodec *find_decoder(AVStream *st, enum AVCodecID codec_id)
102+static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id)
103103 {
104104 if (st->codec->codec)
105105 return st->codec->codec;
@@ -2438,7 +2438,7 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr) · 2332 unmodified lines
24382438 }
24392439
24402440 /* 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)
24422442 {
24432443 const AVCodec *codec;
24442444 int got_picture = 1, ret = 0;
@@ -2452,7 +2452,7 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option · 7 unmodified lines
24522452 if (!avcodec_is_open(st->codec) && !st->info->found_decoder) {
24532453 AVDictionary *thread_opt = NULL;
24542454
2455− codec = find_decoder(st, st->codec->codec_id);
2455+ codec = find_decoder(s, st, st->codec->codec_id);
24562456
24572457 if (!codec) {
24582458 st->info->found_decoder = -1;
@@ -2703,7 +2703,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 244 unmodified lines
27032703 avcodec_get_name(st->codec->codec_id));
27042704 }
27052705 }
2706− codec = find_decoder(st, st->codec->codec_id);
2706+ codec = find_decoder(ic, st, st->codec->codec_id);
27072707
27082708 /* force thread count to 1 since the h264 decoder will not extract SPS
27092709 * and PPS to extradata during multi-threaded decoding */
@@ -2933,7 +2933,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 223 unmodified lines
29332933 least one frame of codec data, this makes sure the codec initializes
29342934 the channel configuration and does not only trust the values from the container.
29352935 */
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);
29372937
29382938 st->codec_info_nb_frames++;
29392939 count++;
@@ -2951,7 +2951,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 11 unmodified lines
29512951 /* flush the decoders */
29522952 if (st->info->found_decoder == 1) {
29532953 do {
2954− err = try_decode_frame(st, &empty_pkt,
2954+ err = try_decode_frame(ic, st, &empty_pkt,
29552955 (options && i < orig_nb_streams) ?
29562956 &options[i] : NULL);
29572957 } while (err > 0 && !has_codec_parameters(st, NULL));
@@ -3154,7 +3154,7 @@ int av_find_best_stream(AVFormatContext *ic, · 196 unmodified lines
31543154 if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED))
31553155 continue;
31563156 if (decoder_ret) {
3157− decoder = find_decoder(st, st->codec->codec_id);
3157+ decoder = find_decoder(ic, st, st->codec->codec_id);
31583158 if (!decoder) {
31593159 if (ret < 0)
31603160 ret = AVERROR_DECODER_NOT_FOUND;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t