[FFmpeg-devel] [PATCH] cdxl: fix duration
Derek Buitenhuis
derek.buitenhuis at gmail.com
Mon Dec 17 18:11:51 CET 2012
On 17/12/2012 6:55 AM, Piotr Bandurski wrote:
> fixes ticket #1937
[...]
> @@ -129,6 +132,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
> audio_size = AV_RB16(&cdxl->header[22]);
> image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
> video_size = palette_size + image_size;
> +
> + frames = cdxl->filesize / (audio_size + video_size);
This seems kind of error prone to me. It doesn't account for things like header, palette
size, and such, I think.
> @@ -175,6 +180,10 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
> st->codec->codec_id = AV_CODEC_ID_CDXL;
> st->codec->width = width;
> st->codec->height = height;
> + if(cdxl->framerate)
> + st->duration = frames;
> + else
> + st->duration = frames * audio_size;
Needs to be properly indented.
- Derek
More information about the ffmpeg-devel
mailing list