[FFmpeg-devel] [PATCH]Recognize "qt " compatible brand in isom
Michael Niedermayer
michaelni at gmx.at
Fri Nov 2 20:08:44 CET 2012
On Fri, Nov 02, 2012 at 07:44:11PM +0100, Clément Bœsch wrote:
> On Fri, Nov 02, 2012 at 07:35:42PM +0100, Carl Eugen Hoyos wrote:
> > On Friday 02 November 2012 03:50:29 pm Clément Bœsch wrote:
> > > On Fri, Nov 02, 2012 at 03:37:32PM +0100, Carl Eugen Hoyos wrote:
> > > > Hi!
> > > >
> > > > Attached patch fixes ticket #1881 for me, I don't know if it has funny
> > > > side-effects.
> > > >
> > > > Please review, Carl Eugen
> > > >
> > > > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > > > index d7d7f21..3488a80 100644
> > > > --- a/libavformat/mov.c
> > > > +++ b/libavformat/mov.c
> > > > @@ -755,6 +755,8 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext
> > > > *pb, MOVAtom atom) avio_read(pb, comp_brands_str, comp_brand_size);
> > > > comp_brands_str[comp_brand_size] = 0;
> > > > av_dict_set(&c->fc->metadata, "compatible_brands", comp_brands_str,
> > > > 0); + if (!strncmp(comp_brands_str, "qt ", 4))
> > > > + c->isom = 0;
> > >
> > > You can have several compatible brands, why would you compare to only one?
> > >
> > > Also, I'm not sure that's a good idea to have a compatible brand with QT
> > > having such "huge" consequence…
> >
> > Less intrusive patch attached.
> >
> > Please comment, Carl Eugen
>
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index d7d7f21..4f1aad1 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -1397,7 +1397,8 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
> >
> > //Read QT version 1 fields. In version 0 these do not exist.
> > av_dlog(c->fc, "version =%d, isom =%d\n",version,c->isom);
> > - if (!c->isom) {
> > + if (!c->isom ||
> > + strstr(av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE)->value, "qt ")) {
> > if (version==1) {
> > sc->samples_per_frame = avio_rb32(pb);
> > avio_rb32(pb); /* bytes per packet */
>
> Might be ok.
Is this special case specific to this use of isom or could isom
itself be changed based on the existence of qt in compatible_brands
?
> But you could also just assume that the "JUNK" major brand is
> an alias for the QuickTime brand, and thus mark the file as non-isom.
iam not sure about this
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121102/2b0817ab/attachment.asc>
More information about the ffmpeg-devel
mailing list