comparison raw.c @ 463:696f41bc8784 libavformat

store index for seeking in the native timebase of each stream set correct timebase for nut merge mpeg-ts seeking with existing seeking code 10l fix in mpegts (27mhz vs. 90khz)
author michael
date Sun, 23 May 2004 16:26:12 +0000
parents e14fcd57ad2f
children 09e46bfc859c
comparison
equal deleted inserted replaced
462:b69898ffc92a 463:696f41bc8784
157 157
158 if (block_align <= 0 || byte_rate <= 0) 158 if (block_align <= 0 || byte_rate <= 0)
159 return -1; 159 return -1;
160 160
161 /* compute the position by aligning it to block_align */ 161 /* compute the position by aligning it to block_align */
162 pos = (timestamp * byte_rate) / AV_TIME_BASE; 162 pos = av_rescale(timestamp * byte_rate, st->time_base.num, st->time_base.den);
163 pos = (pos / block_align) * block_align; 163 pos = (pos / block_align) * block_align;
164 164
165 /* recompute exact position */ 165 /* recompute exact position */
166 st->cur_dts = (pos * AV_TIME_BASE) / byte_rate; 166 st->cur_dts = (pos * AV_TIME_BASE) / byte_rate;
167 url_fseek(&s->pb, pos + s->data_offset, SEEK_SET); 167 url_fseek(&s->pb, pos + s->data_offset, SEEK_SET);