On Tue, Dec 29, 2015 at 08:05:28PM +0000, Eran Kornblau wrote:
> > > > > + case MKTAG('e','n','c','v'): // encrypted video
> > > > > + case MKTAG('e','n','c','a'): // encrypted audio
> > > > > + id = mov_codec_id(st, format);
> > > > > + st->codec->codec_id = id;
> > > >
> > > > this seems missing a check for st->codec->codec_id being "unset"
> > > > before setting it
> > > >
> > > Will add it
> > >
> While testing this change, I found that for audio, at this point codec_id is
> actually already initialized -
> it gets initialized when ff_mov_read_esds calls ff_mp4_read_dec_config_descr,
> in this line:
> st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
>
> What happens with my current code is that this outputs a warning that frma is
> ignored because codec_id
> is not none. I think I will just skip the warning when st->codec->codec_id
> "happens to be" the same as
> the codec that was inferred by the frma atom.
>
> This appears to work well:
> case MKTAG('e','n','c','v'): // encrypted video
> case MKTAG('e','n','c','a'): // encrypted audio
> id = mov_codec_id(st, format);
> if (st->codec->codec_id != AV_CODEC_ID_NONE &&
> st->codec->codec_id != id) {
> av_log(c->fc, AV_LOG_WARNING,
> "ignoring 'frma' atom of '%.4s', stream has codec id %d\n",
> (char*)&format, st->codec->codec_id);
> break;
> }
>
> st->codec->codec_id = id;
> sc->format = format;
> break;
>
> Please let me know if you think that is ok, and I will resubmit the patch
> with all fixes.should be ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
