diff mbox

[FFmpeg-devel] avformat/utils: force native h264 decoder for probing

Message ID 20160921170134.5352-1-timo@rothenpieler.org
State Superseded
Headers show

Commit Message

Timo Rothenpieler Sept. 21, 2016, 5:01 p.m. UTC
---
 libavformat/utils.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Michael Niedermayer Sept. 21, 2016, 9:03 p.m. UTC | #1
On Wed, Sep 21, 2016 at 07:01:34PM +0200, Timo Rothenpieler wrote:
> ---
>  libavformat/utils.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index a9bd034..4c5340b 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -164,6 +164,13 @@ int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src)
>  
>  static const AVCodec *find_decoder(AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id)
>  {
> +#if CONFIG_H264_DECODER
> +    /* Other parts of the code assume this decoder to be used for h264,
> +     * so force it if possible. */
> +    if (codec_id == AV_CODEC_ID_H264)
> +        return avcodec_find_decoder_by_name("h264");
> +#endif

This is also used by av_find_best_stream()  (which returns a AVCodec
as well)

[...]
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a9bd034..4c5340b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -164,6 +164,13 @@  int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src)
 
 static const AVCodec *find_decoder(AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id)
 {
+#if CONFIG_H264_DECODER
+    /* Other parts of the code assume this decoder to be used for h264,
+     * so force it if possible. */
+    if (codec_id == AV_CODEC_ID_H264)
+        return avcodec_find_decoder_by_name("h264");
+#endif
+
 #if FF_API_LAVF_AVCTX
 FF_DISABLE_DEPRECATION_WARNINGS
     if (st->codec->codec)