id summary reporter owner description type status priority milestone component version severity resolution keywords cc mlocked 9511 [patch] avformat decoder buffer underrun (DVB livetv) Jiri Fojtasek Janne Grunau "Since i updated to 0.24 i experienced lots of ""Video buffer failed many times"" during livetv playback. Then i updated to trunk to and the same issues happening to me. This problem happened for me with 90% chance when livetv switching to new program. I using an old computer whish is combined FE/BE. Long story short: - New program coming in to place and switchtoprogram is called - Switch to program took long time and after resuming playback ring buffer is drained - ringbuffer:read() return negative value because no new data is available - This tell avfdecoder than EOF happening and the decoder is closed. Then jumptoprogram is issued. this fail too because EOF is unrecoverable state to the avformat decoder without reopening played file or other hacks. - Then poof and playback is over. I sending two patches: - Firts patch add ""-EAGAIN"" handling support in to mpegts decoder (it is supported in ffmpeg high level API), ringbuffer:read() during livetv playback return -EAGAIN when the buffer is drained (this force ffmpeg and then avformatdecoder deal with this issue itself), return -EIO when no livetv media is played. - Second patch optimizing decoder state handling during switch to program and fixing ""Waited 100ms for decoder to pause"" error messages. Simply, when we pause audio, video processing thread first, decoder will stop sooner because is not blocked by those threads. To apply this new functionality for other playback contexts is required add timeout handling when av_read_frame return -EAGAIN (in nuppel the same in to required places) and return -EAGAIN from ringbuffer:read() when underrun happen. For livetv it is not required timeout handling because its endless stream. I have few gigabytes of logs (-v all) and spent few weeks with debuging this issue. If you like i can grep and post parts of those logs here, but the changes are self explaining and simplest as posible. Jiri " Bug Report closed critical unknown MythTV - Video Playback Master Head high Fixed 0