[FFmpeg-devel] [PATCH 4/4] avidec: demux ASS and SRT tracks
Aurelien Jacobs
aurel
Thu Jul 8 17:28:40 CEST 2010
On Thu, Jul 08, 2010 at 12:52:54AM +0200, Michael Niedermayer wrote:
> On Thu, Jul 08, 2010 at 12:12:00AM +0200, Aurelien Jacobs wrote:
> > On Wed, Jul 07, 2010 at 09:27:30PM +0200, Michael Niedermayer wrote:
> > > On Tue, Jul 06, 2010 at 10:55:04PM +0200, Aurelien Jacobs wrote:
> > > >
> > > > ---
> > > > libavformat/avidec.c | 42 ++++++++++++++++++++++++++++++++++++++++--
> > > > libavformat/utils.c | 2 ++
> > > > 2 files changed, 42 insertions(+), 2 deletions(-)
> > >
> > > > avidec.c | 42 ++++++++++++++++++++++++++++++++++++++++--
> > > > utils.c | 2 ++
> > > > 2 files changed, 42 insertions(+), 2 deletions(-)
> > > > e528c97d940b4d16e1a96f56dd4686a3b8f3b83e avidec-demux-ass-and-srt-track.patch
> > > > diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> > > > index cdf8307..ac1e3b6 100644
> > > > --- a/libavformat/avidec.c
> > > > +++ b/libavformat/avidec.c
> > > > @@ -1138,6 +1170,12 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
> > > > ast2->packet_size=
> > > > ast2->remaining= 0;
> > > >
> > > > + if (st2->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
> > > > + && !st2->codec->codec_tag) {
> > > > + ast2->frame_offset = 0;
> > > > + continue;
> > > > + }
> > >
> > > this doesnt feel correct, all sees go to point 0 ?
> >
> > Well, actually gab2 subtitles are composed of one and only one
> > packet. After seeking, subtitles contained in this packet may be needed
> > (or not, but the avi demuxer has no way to know). So the only thing the
> > avi demuxer can do after a seek is to output this single packet.
> > Did I missed anything ?
>
> this design is sick
Sure it is ! Definitely !
> > @@ -598,6 +598,13 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
> > ast->dshow_block_align = 0;
> > }
> > break;
> > + case AVMEDIA_TYPE_SUBTITLE:
> > + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
> > + st->codec->codec_id = CODEC_ID_PROBE;
> > + st->need_parsing = AVSTREAM_PARSE_FULL;
> > + av_set_pts_info(st, 64, 1, 1000);
>
> > + url_fskip(pb, size);
>
> what is in this data we skip?
Actually nothing !
I've checked it and there is never any data to skip at this point.
It seems to be a remainder of a copy/paste from the default case...
Yes, again... Fixed.
Now I've double checked and I'm pretty sure that there is no such dead
code left anymore.
Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avidec-demux-ass-and-srt-track.diff
Type: text/x-diff
Size: 4568 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100708/544cc49a/attachment.diff>
More information about the ffmpeg-devel
mailing list