[FFmpeg-devel] [PATCH] seperate parser from codec selection

Paul Kendall paul
Tue May 26 11:26:50 CEST 2009

On Tuesday 26 May 2009 07:19:50 pm Paul Kendall wrote:
> On Tuesday 26 May 2009 02:02:09 pm Michael Niedermayer wrote:
> > On Sun, May 17, 2009 at 03:25:22PM +1200, Paul Kendall wrote:
> > > This patch allows an AVStream to specify a parser_id separately to the
> > > codec_id. This will be useful for streams such as DVB-T which has AAC
> > > audio which may be contained in an LATM multiplexed stream.
> > >
> > > The patch will fall-back to using the codec_id for parser selection if
> > > the parser_id is set to CODEC_ID_NONE, which is the default.
> >
> > I do not like having 2 codec ids.
> Ok, the problem I have is that I have a parser for LATM
> CODEC_ID_LATM, there is no codec, so it gets parsed, then nothing!
> I tried changing the codec_id in the parser parse function to
> CODEC_ID_AAC, and it worked for the initial phase of playing i.e.
> determining which codecs to use etc. Then it started to play
> and found that codec_id was CODEC_ID_AAC so it send all the data
> to the aac_parser, and of course that barfed on the LATM stream.
Further investigation shows that the parser was being closed in 
av_estimate_timings_from_pts. This was after the parser had run and
changed the codec_id to CODEC_ID_AAC from CODEC_ID_LATM. When 
av_read_frame was then called it had no parser so it created one,
an AAC parser.

I have attached a patch that in the two places where this was happening
it gets an ID from the parser, closes the parser and constructs a new
one with the previous parser's ID so even though there is a new codec_id
it will use the previous/correct parser type.

Hopefully this patch is acceptable for what needs to be done.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser_reset.patch
Type: text/x-patch
Size: 1001 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090526/fc323ad9/attachment.bin>

More information about the ffmpeg-devel mailing list