[FFmpeg-devel] [PATCH] avformat/rawenc: check stream type

Michael Niedermayer michael at niedermayer.cc
Wed Apr 4 21:39:04 EEST 2018


On Wed, Apr 04, 2018 at 03:53:25PM +0530, Gyan Doshi wrote:
>  rawenc.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> c144b841348e9af26d80e0014daf63c5b2477467  0001-avformat-rawenc-check-stream-type.patch
> From f86916b9e1128a4e41501f4d5b189749a344862f Mon Sep 17 00:00:00 2001
> From: Gyan Doshi <gyandoshi at gmail.com>
> Date: Wed, 4 Apr 2018 15:45:18 +0530
> Subject: [PATCH] avformat/rawenc: check stream type
> 
> Validate codec of stream to be muxed except for data muxer.
> ---
>  libavformat/rawenc.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
> index 809ca23b1a..77cbc5f6fc 100644
> --- a/libavformat/rawenc.c
> +++ b/libavformat/rawenc.c
> @@ -39,6 +39,16 @@ static int force_one_stream(AVFormatContext *s)
>                 s->oformat->name);
>          return AVERROR(EINVAL);
>      }
> +
> +    if (strcmp("data", s->oformat->name)) {
> +        if (s->oformat->audio_codec != AV_CODEC_ID_NONE &&
> +            s->oformat->audio_codec != s->streams[0]->codecpar->codec_id ||
> +            s->oformat->video_codec != s->streams[0]->codecpar->codec_id) {
> +            av_log(s, AV_LOG_ERROR, "Stream not of type %s\n",
> +                   s->oformat->name);

This does not work
breaks fate-unknown_layout-ac3

also the tests mayb too strict, there are similar codec_ids like mpeg1/2
or jpeg variants which are all basically the same from a muxers point of view

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180404/68da0ee7/attachment.sig>


More information about the ffmpeg-devel mailing list