comparison librtmp.c @ 5963:12bdd63f5259 libavformat

Implement librtmp seek support. Implement flv_read_seek(), add a missing check on stream_index and fix timestamp rounding in rtmp_read_seek(). Also add the flv_read_seek2() function, which is not enabled but is useful as reference. To actually implement flv_read_seek2() correctly, there would need to be some corresponding av_url_read_fseek2() function to propagate the timestamps down to the ByteIOContext and URLContext. Patch by Howard Chu <hyc <at> highlandsun.com>. See the thread: Subject: [FFmpeg-devel] RTMP seek support Date: 2010-03-28 23:35:02 GMT
author stefano
date Sun, 18 Apr 2010 19:09:25 +0000
parents e967aa2c1754
children 178de7695c6c
comparison
equal deleted inserted replaced
5962:e967aa2c1754 5963:12bdd63f5259
142 142
143 if (flags & AVSEEK_FLAG_BYTE) 143 if (flags & AVSEEK_FLAG_BYTE)
144 return AVERROR(ENOSYS); 144 return AVERROR(ENOSYS);
145 145
146 /* seeks are in milliseconds */ 146 /* seeks are in milliseconds */
147 timestamp = av_rescale(timestamp, AV_TIME_BASE, 1000); 147 if (stream_index < 0)
148 timestamp = av_rescale_rnd(timestamp, 1000, AV_TIME_BASE,
149 flags & AVSEEK_FLAG_BACKWARD ? AV_ROUND_DOWN : AV_ROUND_UP);
150
148 if (!RTMP_SendSeek(r, timestamp)) 151 if (!RTMP_SendSeek(r, timestamp))
149 return -1; 152 return -1;
150 return timestamp; 153 return timestamp;
151 } 154 }
152 155