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

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


  Branch: refs/heads/fixes/32
  Home:   https://github.com/MythTV/mythtv
  Commit: 31c3ffe0b02073e96c6927fb3f870d392d451adc
      https://github.com/MythTV/mythtv/commit/31c3ffe0b02073e96c6927fb3f870d392d451adc
  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.

(cherry picked from commit 5b448312ba2956176c2f081aeba48bfbf13d1a84)


  Commit: 911833db526034615f04530988621181e88beb55
      https://github.com/MythTV/mythtv/commit/911833db526034615f04530988621181e88beb55
  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.

(cherry picked from commit 32420c58703bfc39dcf96c874c5bcc99e421e232)


  Commit: 126a962af4ad8d97c7a69c92964b728af346fd4a
      https://github.com/MythTV/mythtv/commit/126a962af4ad8d97c7a69c92964b728af346fd4a
  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.

(cherry picked from commit 754d740d00455aaacbe7926520816dc72830b67e)


  Commit: 467c2c77be743683750f263bc684d837174fb0ee
      https://github.com/MythTV/mythtv/commit/467c2c77be743683750f263bc684d837174fb0ee
  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.

(cherry picked from commit f81e93848af2a3acb693a0c0e66c677f80d3fb0a)


  Commit: c1d8ce76b23858fe203e43462d15580bb0a68c25
      https://github.com/MythTV/mythtv/commit/c1d8ce76b23858fe203e43462d15580bb0a68c25
  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.

(cherry picked from commit b26d303e268d9fe62a5aceb09f5afa51a948f347)


Compare: https://github.com/MythTV/mythtv/compare/5fb6936c2ac4...c1d8ce76b238


More information about the mythtv-commits mailing list