[FFmpeg-devel] [PATCH] 8088flex TMV demuxer and decoder

Reimar Döffinger Reimar.Doeffinger
Thu Apr 23 10:17:20 CEST 2009

On Wed, Apr 22, 2009 at 12:37:14AM -0500, Daniel Verkamp wrote:
> +    if (AV_RL32(p->buf) == TMV_TAG)

Could also use strncmp...

> +    if (get_le32(pb) != TMV_TAG)
> +        return -1;

> if (get_le32(pb) != AL_RL32("TMAV"))
would be possible, too.

> +    ast->codec->sample_rate = get_le16(pb);

Is this necessary? I see it in a lot of demuxers, when an why should
that be set?
I'd think just av_set_pts_info should be enough...

> +    if (url_feof(pb))
> +        return AVERROR_EOF;

Seems pointless, av_get_packet should catch it.

> +    pkt->pts                     = tmv->pts[tmv->stream_index];
> +    tmv->pts[tmv->stream_index] += tmv->pts_inc[tmv->stream_index];

I think you should get the same result if you just remove these and let
ffmpeg calculate the pts. You should then get working seeking when you
set AVFMT_GENERIC_INDEX in AVInputFormat and set PKT_FLAG_KEY correctly
(I think all frames are keyframes for this format).

More information about the ffmpeg-devel mailing list