[FFmpeg-devel] [PATCH] MTH demuxer (Gamecube format)

Michael Montanye montanye
Wed Feb 4 00:09:34 CET 2009


Michael Niedermayer wrote:

[...]

>> +    framerate            = av_d2q(fps, INT_MAX);
>>     
> [...]
>   
>> +    st->codec->sample_rate  = av_q2d(framerate);
>>     
>
> this code looks rather suboptimal
>
>   
It is.  Fixed.
>   
>> +
>> +    return 0;
>> +}
>> +
>> +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);
>>     
>
> unneeded
>   
Without it, decoding terminates on the first frame with an empty frame.
>> +    ret = av_get_packet(pb, pkt, size);
>> +    if (ret != size) {
>> +        av_free_packet(pkt);
>> +        return AVERROR(EIO);
>> +    }
>>     
>
> id say av_free_packet() should only be called if ret>=0
>
>   
Okay.  Fixed, new patch attached.

-Michael Montanye
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mth-demuxer3.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090203/753c06c0/attachment.txt>



More information about the ffmpeg-devel mailing list