[FFmpeg-devel] [PATCH] ffplay: set codec_id in codec context

Marton Balint cus at passwd.hu
Sat Dec 15 23:34:01 CET 2012



On Sat, 15 Dec 2012, Stefano Sabatini wrote:

> Set codec id in case another codec is forced on the context (e.g. when
> the user specify the codec with -codec).
>
> For example fix:
> ffplay -vcodec pgmyuv -i "tests/vsynth1/%02d.pgm"
> ---
> ffplay.c |    1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/ffplay.c b/ffplay.c
> index 1bd07f4..a45def4 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2317,6 +2317,7 @@ static int stream_component_open(VideoState *is, int stream_index)
>     if (!codec)
>         return -1;
>
> +    avctx->codec_id = codec->id;
>     avctx->workaround_bugs   = workaround_bugs;
>     avctx->lowres            = lowres;
>     if(avctx->lowres > codec->max_lowres){

LGTM, thanks,

Marton


More information about the ffmpeg-devel mailing list