[FFmpeg-cvslog] r11625 - trunk/libavformat/mov.c

Baptiste Coudurier baptiste.coudurier
Sun Jan 27 16:15:01 CET 2008


Reimar D?ffinger wrote:
> On Sun, Jan 27, 2008 at 03:40:02PM +0100, Baptiste Coudurier wrote:
>> reimar wrote:
>>> Author: reimar
>>> Date: Sat Jan 26 22:21:55 2008
>>> New Revision: 11625
>>>
>>> Log:
>>> Extract the pure plaintext from mov text subtitles.
>>> Formatting information etc. is discarded.
>>>
>>>
>>> Modified:
>>>    trunk/libavformat/mov.c
>>>
>>> Modified: trunk/libavformat/mov.c
>>> ==============================================================================
>>> --- trunk/libavformat/mov.c	(original)
>>> +++ trunk/libavformat/mov.c	Sat Jan 26 22:21:55 2008
>>> @@ -1542,6 +1542,12 @@ static int mov_read_packet(AVFormatConte
>>>      } else {
>>>  #endif
>>>          av_get_packet(s->pb, pkt, sample->size);
>>> +        if (s->streams[sc->ffindex]->codec->codec_id == CODEC_ID_TEXT) {
>>> +            int textlen = FFMIN(AV_RB16(pkt->data), sample->size - 2);
>>> +            textlen = FFMAX(textlen, 0);
>>> +            memmove(pkt->data, pkt->data + 2, textlen);
>>> +            pkt->size = textlen;
>>> +        }
>> This is awfully hackish. IMHO codec id CODEC_ID_MOV_TEXT must be
>> implemented and this mess must be done at the codec level.
>> Please revert !
> 
> A CODEC_ID_MOV_TEXT is rather pointless with nobody supporting it, and
> given the format I have some doubts it will ever be supported.

This is a bad justification for hacks.

> In addition this was the way thing were handled for Matroska subtitles
> at first as well...

One demuxer already doing hacks is not a justification either.

> And lastly, while I miss the specifications to say for sure, the
> subtitle format seems to be created on purpose the way that there is
> first a pure plaintext version and then a formatted text version in one
> packet, which makes this way to handle it seem much less hackish.

Data might be there on purpose and must be kept with stream copy.
Extracting data can be done at bitstream parser and better at codec
level if you want to get AVSubtitle structure.

Please revert.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-cvslog mailing list