summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-11-16 14:26:50 +0000
committerMike Melanson <mike@multimedia.cx>2003-11-16 14:26:50 +0000
commit11498da3349242747ab2b7680972a51e275cd06e (patch)
tree548e28ca314c357fdef47101a33bb7297df8e39b /libavformat/4xm.c
parentd66dae57e8e978fe1f28b917d29f9df8f9af7449 (diff)
downloadffmpeg-11498da3349242747ab2b7680972a51e275cd06e.tar.gz
set frame rate information, for good measure
Originally committed as revision 2521 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 2caa08f4c7..2214e11747 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -86,6 +86,7 @@ typedef struct FourxmDemuxContext {
int64_t audio_pts;
int64_t video_pts;
int video_pts_inc;
+ float fps;
} FourxmDemuxContext;
static float get_le_float(unsigned char *buffer)
@@ -132,11 +133,11 @@ static int fourxm_read_header(AVFormatContext *s,
int i;
int current_track = -1;
AVStream *st;
- float fps;
fourxm->track_count = 0;
fourxm->tracks = NULL;
fourxm->selected_track = 0;
+ fourxm->fps = 1.0;
/* skip the first 3 32-bit numbers */
url_fseek(pb, 12, SEEK_CUR);
@@ -160,8 +161,8 @@ static int fourxm_read_header(AVFormatContext *s,
size = LE_32(&header[i + 4]);
if (fourcc_tag == std__TAG) {
- fps = get_le_float(&header[i + 12]);
- fourxm->video_pts_inc = (int)(90000.0 / fps);
+ fourxm->fps = get_le_float(&header[i + 12]);
+ fourxm->video_pts_inc = (int)(90000.0 / fourxm->fps);
} else if (fourcc_tag == vtrk_TAG) {
/* check that there is enough data */
if (size != vtrk_SIZE) {
@@ -179,6 +180,8 @@ static int fourxm_read_header(AVFormatContext *s,
fourxm->video_stream_index = st->index;
+ st->codec.frame_rate = fourxm->fps;
+ st->codec.frame_rate_base = 1.0;
st->codec.codec_type = CODEC_TYPE_VIDEO;
st->codec.codec_id = CODEC_ID_4XM;
st->codec.codec_tag = 0; /* no fourcc */