| 71 | } |
| 72 | |
| 73 | static const AVCodec *find_probe_decoder(AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id) |
| 74 | { |
| 75 | const AVCodec *codec; |
| 76 | |
| 77 | #if CONFIG_H264_DECODER |
| 78 | /* Other parts of the code assume this decoder to be used for h264, |
| 79 | * so force it if possible. */ |
| 80 | if (codec_id == AV_CODEC_ID_H264) |
| 81 | return avcodec_find_decoder_by_name("h264"); |
| 82 | #endif |
| 83 | |
| 84 | codec = ff_find_decoder(s, st, codec_id); |
| 85 | if (!codec) |
| 86 | return NULL; |
| 87 | |
| 88 | if (codec->capabilities & AV_CODEC_CAP_AVOID_PROBING) { |
| 89 | const AVCodec *probe_codec = NULL; |
| 90 | void *iter = NULL; |
| 91 | while ((probe_codec = av_codec_iterate(&iter))) { |
| 92 | if (probe_codec->id == codec->id && |
| 93 | av_codec_is_decoder(probe_codec) && |
| 94 | !(probe_codec->capabilities & (AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_EXPERIMENTAL))) { |
| 95 | return probe_codec; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | return codec; |
| 101 | } |
| 102 | |
| 103 | static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, |
| 104 | AVProbeData *pd) |
no test coverage detected