mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
mpegts: remove read_seek()
Its redundant Found-by: nevcairiel Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
08d4408a90
commit
a0a4b13322
@ -1876,32 +1876,6 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, in
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){
|
||||
MpegTSContext *ts = s->priv_data;
|
||||
uint8_t buf[TS_PACKET_SIZE];
|
||||
int64_t pos;
|
||||
|
||||
if(av_seek_frame_binary(s, stream_index, target_ts, flags) < 0)
|
||||
return -1;
|
||||
ff_read_frame_flush(s);
|
||||
return 0;
|
||||
pos= avio_tell(s->pb);
|
||||
|
||||
for(;;) {
|
||||
avio_seek(s->pb, pos, SEEK_SET);
|
||||
if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
|
||||
return -1;
|
||||
// pid = AV_RB16(buf + 1) & 0x1fff;
|
||||
if(buf[1] & 0x40) break;
|
||||
pos += ts->raw_packet_size;
|
||||
}
|
||||
avio_seek(s->pb, pos, SEEK_SET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**************************************************************/
|
||||
@ -1968,7 +1942,6 @@ AVInputFormat ff_mpegts_demuxer = {
|
||||
.read_header = mpegts_read_header,
|
||||
.read_packet = mpegts_read_packet,
|
||||
.read_close = mpegts_read_close,
|
||||
.read_seek = read_seek,
|
||||
.read_timestamp = mpegts_get_dts,
|
||||
.flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT,
|
||||
#ifdef USE_SYNCPOINT_SEARCH
|
||||
@ -1983,7 +1956,6 @@ AVInputFormat ff_mpegtsraw_demuxer = {
|
||||
.read_header = mpegts_read_header,
|
||||
.read_packet = mpegts_raw_read_packet,
|
||||
.read_close = mpegts_read_close,
|
||||
.read_seek = read_seek,
|
||||
.read_timestamp = mpegts_get_dts,
|
||||
.flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT,
|
||||
#ifdef USE_SYNCPOINT_SEARCH
|
||||
|
Loading…
Reference in New Issue
Block a user