Opened 18 years ago

Closed 18 years ago

#900 closed patch (fixed)

HDTV at greater than 1.0 speed stutters

Reported by: jppoet@… Owned by: danielk
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

By simply changing the readblocksize in RingBuffer?.cpp, I can now watch HD programs at up to 1.2x speed without it stuttering.

Unfortunately, 1.2x is as fast as I can go before the stuttering returns.

Patch is attached.

John

Attachments (1)

RingBuffer.patch (465 bytes) - added by jppoet@… 18 years ago.
Modify readblocksize for smoother playback.

Download all attachments as: .zip

Change History (3)

Changed 18 years ago by jppoet@…

Attachment: RingBuffer.patch added

Modify readblocksize for smoother playback.

comment:1 Changed 18 years ago by danielk

Milestone: 0.20
Owner: changed from Isaac Richards to danielk
Version: head

John I don't want to commit this before 0.19 because RingBuffer::CalcReadAheadThresh?() changes tend to break things, but I will commit something similar that should allow > 1.2 playback as well by adjusting the buffering for faster playback.

I think this change, as is, could further break smooth ringbuffer switching.

comment:2 Changed 18 years ago by danielk

Resolution: fixed
Status: newclosed

(In [8841]) Fixes #971. Fixes #900.

In SwitchToProgram?() we check if we close to the end before doing a switch. This was safe for low bitrate programs, but with high bitrate programs the RingBuffer? was initialized with a larger readblocksize. Also the valid video frames check isn't terribly valid with nVidia XvMC, which uses a total of only 8 video buffers.

This reworks this check and moves it to NVP::IsReallyNearEnd?(). It uses information from the RingBuffer? to set the thresholds so it scales with different bitrates. Also, the ringbuffer now takes the play_speed into account when using timestretch. The raw bitrate as reported by ffmpeg is scaled by timestretch value. Also since IsReallyNearEnd?() is using the real readblocksize in it's calculations, I've applied John Poet's patch for making 1080i @ >=1.2 timestretch work by increasing the readblocksize.

The params may need some tuning for the best performance. The values I used are both theoretically safe and worked for the 400 ringbuffer switches I threw at it. But the params are somewhat conservative. When I used the theoretical minimums, I did observe a lockup after about 70 switches, so my model isn't perfect.

Note: See TracTickets for help on using tickets.