[FFmpeg-devel] [PATCH]Report "unknown codec" instead of "unspecifed size" if the codec is unknown

Michael Niedermayer michaelni at gmx.at
Sun Jun 1 19:21:10 CEST 2014


On Sun, Jun 01, 2014 at 02:20:17PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Currently, has_codec_parameters() fails with "unspecified size" if nothing 
> is known about a video stream, I believe it makes more sense to report 
> "unknown codec" with highest priority.
> 
> Please comment, Carl Eugen

>  utils.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> d48d7af9201240b803a741710442c97017295fec  patchunkowncodec.diff
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 1f72241..3d32a41 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2644,6 +2644,8 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
>          return 0;                                                 \
>      } while (0)
>  
> +    if (avctx->codec_id == AV_CODEC_ID_NONE)
> +        FAIL("unknown codec");

ID_NONE is allowed in the AVMEDIA_TYPE_DATA case prior to this patch

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140601/0ceb694a/attachment.asc>


More information about the ffmpeg-devel mailing list