Mercurial > libavformat.hg
comparison psxstr.c @ 462:b69898ffc92a libavformat
move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
author | michael |
---|---|
date | Fri, 21 May 2004 20:43:21 +0000 |
parents | c152849ee643 |
children | 0fdc96c2f2fe |
comparison
equal
deleted
inserted
replaced
461:63540e5504f7 | 462:b69898ffc92a |
---|---|
133 str->pts = 0; | 133 str->pts = 0; |
134 str->audio_channel = -1; /* assume to audio or video */ | 134 str->audio_channel = -1; /* assume to audio or video */ |
135 str->video_channel = -1; | 135 str->video_channel = -1; |
136 str->video_chunk = NULL; | 136 str->video_chunk = NULL; |
137 | 137 |
138 /* set the pts reference (1 pts = 1/90000) */ | |
139 s->pts_num = 1; | |
140 s->pts_den = 90000; | |
141 | 138 |
142 /* skip over any RIFF header */ | 139 /* skip over any RIFF header */ |
143 if (get_buffer(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE) | 140 if (get_buffer(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE) |
144 return AVERROR_IO; | 141 return AVERROR_IO; |
145 if (LE_32(§or[0]) == RIFF_TAG) | 142 if (LE_32(§or[0]) == RIFF_TAG) |
176 | 173 |
177 /* allocate a new AVStream */ | 174 /* allocate a new AVStream */ |
178 st = av_new_stream(s, 0); | 175 st = av_new_stream(s, 0); |
179 if (!st) | 176 if (!st) |
180 return AVERROR_NOMEM; | 177 return AVERROR_NOMEM; |
178 /* set the pts reference (1 pts = 1/90000) */ | |
179 av_set_pts_info(st, 33, 1, 90000); | |
181 | 180 |
182 str->channels[channel].video_stream_index = st->index; | 181 str->channels[channel].video_stream_index = st->index; |
183 | 182 |
184 st->codec.codec_type = CODEC_TYPE_VIDEO; | 183 st->codec.codec_type = CODEC_TYPE_VIDEO; |
185 st->codec.codec_id = CODEC_ID_MDEC; | 184 st->codec.codec_id = CODEC_ID_MDEC; |
204 | 203 |
205 /* allocate a new AVStream */ | 204 /* allocate a new AVStream */ |
206 st = av_new_stream(s, 0); | 205 st = av_new_stream(s, 0); |
207 if (!st) | 206 if (!st) |
208 return AVERROR_NOMEM; | 207 return AVERROR_NOMEM; |
208 av_set_pts_info(st, 33, 1, 90000); | |
209 | 209 |
210 str->channels[channel].audio_stream_index = st->index; | 210 str->channels[channel].audio_stream_index = st->index; |
211 | 211 |
212 fmt = sector[0x13]; | 212 fmt = sector[0x13]; |
213 st->codec.codec_type = CODEC_TYPE_AUDIO; | 213 st->codec.codec_type = CODEC_TYPE_AUDIO; |