[mythtv-commits] [MythTV/mythtv] 5b4483: Fix issues with the decoder loop stalling due to m...

David Engel noreply at github.com
Fri Feb 4 02:02:07 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: 5b448312ba2956176c2f081aeba48bfbf13d1a84
      https://github.com/MythTV/mythtv/commit/5b448312ba2956176c2f081aeba48bfbf13d1a84
  Author: David Engel <dengel at mythtv.org>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp
    M mythtv/libs/libmythtv/DVD/mythdvdplayer.h
    M mythtv/libs/libmythtv/mythplayer.cpp
    M mythtv/libs/libmythtv/mythplayer.h

  Log Message:
  -----------
  Fix issues with the decoder loop stalling due to mediacodec retries.

Commit 47df3efb tried to improve the handling of retries with the
mediacodec decoder.  It still left cases where the decoder loop would
retry for up to 5 seconds and block the UI/event loop during that
time.  This commit refactors the retry logic again so that the entire,
decoder loop can continue to execute with minimal delays.  This mainly
affected the "decode one frame" logic and rippled into the ff/rew,
skip logic.

Since making this change, I have not run into any cases where neither
the decoder loop nor the mediacodec decoder gets stuck.  Also note
that this change doesn't fix the problem when using mediacodec and
surface rendering where the video doesn't update in ff/rew mode.  I
will try to address that in a future update.


  Commit: 32420c58703bfc39dcf96c874c5bcc99e421e232
      https://github.com/MythTV/mythtv/commit/32420c58703bfc39dcf96c874c5bcc99e421e232
  Author: David Engel <dengel at mythtv.org>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M mythtv/libs/libmythtv/mythplayer.cpp
    M mythtv/libs/libmythtv/mythplayer.h

  Log Message:
  -----------
  Revert unnecessary, mediacodec, work around.

Revert commit 421c0a795a9.  The problem which led to it is believed to
have been fixed by the previous, mediacodec, retry fix.


  Commit: 754d740d00455aaacbe7926520816dc72830b67e
      https://github.com/MythTV/mythtv/commit/754d740d00455aaacbe7926520816dc72830b67e
  Author: David Engel <dengel at mythtv.org>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M mythtv/libs/libmythtv/mythplayer.cpp

  Log Message:
  -----------
  Try to avoid using invalid, video buffers inv video loop.

When the decoder performs a seek, all video buffers are discarded.
However, the video loop blindly keeps reading the next buffer in the
used queue without checking that it's valid.  This change makes sure
there is at least one, valid buffer.

Note, there is still a race conditioin that can cause an invalid
buffer to be used.  Fully fixing that would require a much bigger
change than I'm prepared to make right now.


  Commit: f81e93848af2a3acb693a0c0e66c677f80d3fb0a
      https://github.com/MythTV/mythtv/commit/f81e93848af2a3acb693a0c0e66c677f80d3fb0a
  Author: David Engel <dengel at mythtv.org>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M mythtv/libs/libmythtv/mythplayer.cpp
    M mythtv/libs/libmythtv/mythplayer.h
    M mythtv/libs/libmythtv/mythplayerui.cpp

  Log Message:
  -----------
  Work around an FF/Rew issue when using mediacodec/surface.

FF/Rew works by repeatedly decoding a keyframe and then seeking to a
new keyframe some distance away.  This usually results in several
keyframes in the videobuffer queue waiting to be displayed.
Unfortunately, when using mediacodec with surface rendering, Android
appears to not be able to render a frame after a seek has occurred.
The result is that the video appears frozen with the last, rendered
frame while the ff/rew continues.

This commit works around the issue by enabling a new, "render one"
mode for ff/rew when using mediacodec/surface.  In this mode, after
decoding a keyframe and queuing it for display, the decoder waits for
the frame to be rendered before seeking to the next keyframe.  In
effect, it synchronizes the decoder and display loops to handling one
frame at a time.


  Commit: b26d303e268d9fe62a5aceb09f5afa51a948f347
      https://github.com/MythTV/mythtv/commit/b26d303e268d9fe62a5aceb09f5afa51a948f347
  Author: David Engel <dengel at mythtv.org>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M mythtv/libs/libmythtv/mythplayer.cpp

  Log Message:
  -----------
  Fix setting of player, frame rate in ff/rew mode.


Compare: https://github.com/MythTV/mythtv/compare/872dad39a440...b26d303e268d


More information about the mythtv-commits mailing list