[FFmpeg-devel] [PATCH] Fix FLIC (with attachment)
Michael Niedermayer
michaelni
Mon Sep 3 19:51:49 CEST 2007
Hi
On Mon, Sep 03, 2007 at 09:03:18AM -0700, Mike Melanson wrote:
> I simply don't believe it... forgetting attachment. I guess it happens
> to the best of us.
>
> -------- Original Message --------
> Subject: [PATCH] Fix FLIC
> Date: Mon, 03 Sep 2007 09:01:28 -0700
> From: Mike Melanson <mike at multimedia.cx>
> To: FFMpeg development discussions and patches <ffmpeg-devel at mplayerhq.hu>
>
> Hi,
>
> The attached patch to flicvideo.c fixes issue 123:
>
> Support Magic-carpet fli version
> https://roundup.mplayerhq.hu/roundup/ffmpeg/issue123
>
> In the course of fixing this, I noticed that no FLIC files seemed to
> work on my setup. This patch also revises the flic.c demuxer to support
> the newer PTS system properly.
1 issue, 1 commit please :)
[...]
> Index: libavformat/flic.c
> ===================================================================
> --- libavformat/flic.c (revision 10287)
> +++ libavformat/flic.c (working copy)
> @@ -22,7 +22,7 @@
> /**
> * @file flic.c
> * FLI/FLC file demuxer
> - * by Mike Melanson (melanson at pcisys.net)
> + * by Mike Melanson
> * for more information on the .fli/.flc file format and all of its many
> * variations, visit:
> * http://www.compuphase.com/flic.htm
commit seperately please
[...]
> /* Time to figure out the framerate: If there is a FLIC chunk magic
> * number at offset 0x10, assume this is from the Bullfrog game,
> * Magic Carpet. */
> if (AV_RL16(&header[0x10]) == FLIC_CHUNK_MAGIC_1) {
>
> - flic->frame_pts_inc = FLIC_MC_PTS_INC;
> + flic->speed = FLIC_MC_SPEED;
> + av_set_pts_info(st, 33, 1, 70);
av_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
>
> /* rewind the stream since the first chunk is at offset 12 */
> url_fseek(pb, 12, SEEK_SET);
> @@ -127,35 +126,21 @@
> memcpy(st->codec->extradata, header, 12);
>
> } else if (magic_number == FLIC_FILE_MAGIC_1) {
> - /*
> - * in this case, the speed (n) is number of 1/70s ticks between frames:
> - *
> - * pts n * frame #
> - * -------- = ----------- => pts = n * (90000/70) * frame #
> - * 90000 70
> - *
> - * therefore, the frame pts increment = n * 1285.7
> - */
> - flic->frame_pts_inc = speed * 1285.7;
> +
> + av_set_pts_info(st, 33, 1, 70);
> +
av_set_pts_info(st, 64, flic->speed, 70);
> } else if ((magic_number == FLIC_FILE_MAGIC_2) ||
> (magic_number == FLIC_FILE_MAGIC_3)) {
> - /*
> - * in this case, the speed (n) is number of milliseconds between frames:
> - *
> - * pts n * frame #
> - * -------- = ----------- => pts = n * 90 * frame #
> - * 90000 1000
> - *
> - * therefore, the frame pts increment = n * 90
> - */
> - flic->frame_pts_inc = speed * 90;
> +
> + av_set_pts_info(st, 33, 1, 1000);
av_set_pts_info(st, 64, flic->speed, 1000);
[...]
> @@ -188,7 +173,7 @@
> break;
> }
> pkt->stream_index = flic->video_stream_index;
> - pkt->pts = flic->pts;
> + pkt->pts = flic->frame_number * flic->speed;
pkt->pts = flic->frame_number;
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070903/55371dae/attachment.pgp>
More information about the ffmpeg-devel
mailing list