[FFmpeg-devel] [PATCH] MTH demuxer (Gamecube format)
Michael Montanye
montanye
Wed Feb 4 04:02:01 CET 2009
Michael Niedermayer wrote:
>> Without it, decoding terminates on the first frame with an empty frame.
>>
> [...]
>
>> + mth->first_frame = get_be32(pb);
>>
>
> you need to seek to this at the end of reading the header
>
>
Ah. Fixed.
>> +static int mth_read_packet(AVFormatContext *s, AVPacket *pkt)
>> +{
>> + MthDemuxContext *mth = s->priv_data;
>> + ByteIOContext *pb = s->pb;
>> + int size;
>> + int ret;
>> +
>> + url_fseek(pb, mth->next_frame, SEEK_SET);
>> +
>> + size = mth->next_framesz;
>> +
>> + /* Locate the next frame and read out its size. */
>> + mth->next_frame += mth->next_framesz;
>> + mth->next_framesz = get_be32(pb);
>> +
>> + ret = av_get_packet(pb, pkt, size);
>>
>
> this looks odd
> if the value stored is the difference between frames it cant at the
> same time be the size of the codec frame, (theres should be a 4 byte
> difference)
You're right; having the seek in mth_read_packet was hiding that four-byte overreach. Fixed.
>> + if (ret != size) {
>> + if (ret >= 0) {
>> + av_free_packet(pkt);
>> + }
>>
>
> tabs
>
>
I thought I had changed that in this editor. Fixed, new patch attached.
-Michael Montanye
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mth-demuxer4.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090203/2890f5cd/attachment.txt>
More information about the ffmpeg-devel
mailing list