[FFmpeg-devel] [PATCH] Funcom ISS playback

Stefan Gehrer stefan.gehrer
Sat Jan 17 14:19:05 CET 2009


Michael Niedermayer wrote:

>> +static char *get_token(ByteIOContext *s, char *buf, int maxlen)
>> +{
>> +    int i = 0;
>> +    char c;
>> +
> 
>> +    while ((c = get_byte(s)) != ' ') {
>> +        if (i < maxlen-1)
>> +            buf[i++] = c;
>> +    }
> 
> this can end in an infinite loop

fixed.

> 
>> +    buf[i] = 0; /* Ensure null terminated, but may be truncated */
>> +
>> +    return buf;
>> +}
> 
> the return is not used thus not needed

removed.

> [...]
>> +static int iss_read_header(AVFormatContext *s,
> 
> missing av_cold 

added.

> [...]
>> +static int iss_read_packet(AVFormatContext *s,
>> +                           AVPacket *pkt)
>> +{
>> +    IssDemuxContext *iss = s->priv_data;
>> +    int ret = av_get_packet(s->pb, pkt, iss->packet_size);
>> +
>> +    if(ret < 0)
>> +        return ret;
>> +
>> +    pkt->stream_index = 0;
>> +    pkt->pts = url_ftell(s->pb) - iss->sample_start_pos;
> 
>> +    if(s->streams[0]->codec->channels > 0)
>> +        pkt->pts /= s->streams[0]->codec->channels*2;
> 
> how could channels be <= 0 ?

I don't know, someone calling read_packet before read_header?
Should I remove that check again?

> 
>> +    return 0;
>> +}
>> +
>> +AVInputFormat iss_demuxer = {
>> +    "ISS",
>> +    "Funcom ISS format",
> 
> missing NULL_IF_CONFIG_SMALL()

added, patch attached.

Stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: funcomiss.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090117/480fce81/attachment.txt>



More information about the ffmpeg-devel mailing list