[FFmpeg-devel] [PATCH v5] lavf/matroskadec: A_QUICKTIME and AV_CODEC_ID_NONE

Michael Niedermayer michael at niedermayer.cc
Fri Jan 8 11:58:06 CET 2016


On Wed, Jan 06, 2016 at 04:32:25AM +0100, Mats Peterson wrote:
> In many older QuickTime files, the audio format, or "fourcc", is
> 0x00000000 (AV_CODEC_ID_NONE). The QuickTime File Format Specification
> states the following regarding this situation:
> 
> "This format descriptor should not be used, but may be found in some
> files. Samples are assumed to be stored in either 'raw ' or 'twos'
> format, depending on the sample size field in the sound description."
> 
> MPlayer handles this logic by itself, but FFmpeg/FFplay currently does
> not.
> 
> Mats
> 
> -- 
> Mats Peterson
> http://matsp888.no-ip.org/~mats/

>  matroskadec.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> a8ee382fbe551d1f6fc965e81d79066245333bcc  0001-lavf-matroskadec-A_QUICKTIME-and-AV_CODEC_ID_NONE.patch
> From 9adba279d3ca9dada9774ff204e7fb4a255bfb9e Mon Sep 17 00:00:00 2001
> From: Mats Peterson <matsp888 at yahoo.com>
> Date: Wed, 6 Jan 2016 04:13:47 +0100
> Subject: [PATCH v5] lavf/matroskadec: A_QUICKTIME and AV_CODEC_ID_NONE
> 
> In many older QuickTime files, the audio format, or "fourcc", is
> 0x00000000 (AV_CODEC_ID_NONE). The QuickTime File Format Specification
> states the following regarding this situation:
> 
> "This format descriptor should not be used, but may be found in some
> files. Samples are assumed to be stored in either 'raw ' or 'twos'
> format, depending on the sample size field in the sound description."
> 
> MPlayer handles this logic by itself, but FFmpeg/FFplay currently does
> not.
> 
> Mats
> 
> ---
>  libavformat/matroskadec.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 9de7cfb..440c9f9 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -1869,6 +1869,15 @@ static int matroska_parse_tracks(AVFormatContext *s)
>                  fourcc = AV_RL32(track->codec_priv.data);
>                  codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
>              }
> +            if (codec_id == AV_CODEC_ID_NONE) {
> +                if (track->audio.bitdepth == 8) {
> +                    fourcc = MKTAG('r','a','w',' ');
> +                    codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
> +                } else if (track->audio.bitdepth == 16) {
> +                    fourcc = MKTAG('t','w','o','s');
> +                    codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
> +                }
> +            }
>          } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&

where can i find a file to test this and the mov patch ?
also codec_id will be AV_CODEC_ID_NONE for any new fourcc that is
not supported not just fourcc == 0
does it work to check fourcc or the place that fourcc is stored
i addition or instead of codec_id ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160108/3c03889f/attachment.sig>


More information about the ffmpeg-devel mailing list