Opened 2 years ago

Closed 2 years ago

#8686 closed defect (needs_more_info)

mpegts unexpected "Unable to seek back to the start"

Reported by: dista Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Input is mpegts over srt stream, sometimes it logs "Unable to seek back to the start" in the beginning.
After debugging, I think it is caused by mpegts.c's get_packet_size() function.

here is what happend:

  1. it call avio_read_partial(), and get 1316 bytes
  2. it calculate score=7, dvhs=2(maybe some 0x47 in middle),fec_score=2
  3. because score(7) == margin(2+5), it need to go to next round
  4. it call avio_read_partial(), but in that function "len=s->buf_end - s->buf_ptr" just equals 0, so it run "s->buf_end = s->buf_ptr = s->buffer", after that the data in buffer is dropped.
  5. after that, it will call seek_back(), and because we dropped data in buffer, we can not seek back.

I can remove "s->buf_end = s->buf_ptr = s->buffer" in avio_read_partial() to fix this problem, but it may break other things.

Change History (2)

comment:1 by Marton Balint, 2 years ago

You should provide the complete command line and the console output to make this a valid report.

comment:2 by Carl Eugen Hoyos, 2 years ago

Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.