commit 17bb6963d89423fe6c0d591f8cf309b62f299354
Author: Mark Spieth <mspieth@digivation.com.au>
Date: Sat Aug 29 21:52:40 2009 +1000
smoother video sync so tickers scroll smoothly at any speed
diff --git a/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp b/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
index dedfe0f..1d0f905 100644
a
|
b
|
using namespace std; |
26 | 26 | #include <QKeyEvent> |
27 | 27 | #include <QDir> |
28 | 28 | |
| 29 | #define NEW_AVSYNC |
| 30 | |
29 | 31 | // MythTV headers |
30 | 32 | #include "mythconfig.h" |
31 | 33 | #include "mythdbcon.h" |
… |
… |
void NuppelVideoPlayer::AVSync(void) |
2491 | 2493 | // the vertical sync (e.g. VDPAU) |
2492 | 2494 | videoOutput->PrepareFrame(buffer, kScan_Intr2ndField); |
2493 | 2495 | videoOutput->Show(kScan_Intr2ndField); |
2494 | | VERBOSE(VB_PLAYBACK, LOC + dbg + "skipping A/V wait."); |
| 2496 | VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, LOC + dbg + "skipping A/V wait."); |
2495 | 2497 | } |
2496 | 2498 | else |
2497 | 2499 | { |
2498 | 2500 | // If we are using software decoding, skip this frame altogether. |
| 2501 | //VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, LOC + dbg + "dropping frame."); |
2499 | 2502 | VERBOSE(VB_PLAYBACK, LOC + dbg + "dropping frame to catch up."); |
2500 | 2503 | } |
2501 | 2504 | } |
… |
… |
void NuppelVideoPlayer::AVSync(void) |
2505 | 2508 | if (buffer) |
2506 | 2509 | videoOutput->PrepareFrame(buffer, ps); |
2507 | 2510 | |
| 2511 | VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, QString("AVSync waitforframe %1 %2").arg(avsync_adjustment).arg(m_double_framerate)); |
2508 | 2512 | videosync->WaitForFrame(avsync_adjustment); |
| 2513 | VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, "AVSync show"); |
2509 | 2514 | if (!resetvideo) |
2510 | 2515 | videoOutput->Show(ps); |
2511 | 2516 | |
… |
… |
void NuppelVideoPlayer::AVSync(void) |
2546 | 2551 | |
2547 | 2552 | // Display the second field |
2548 | 2553 | videosync->AdvanceTrigger(); |
| 2554 | #ifdef NEW_AVSYNC |
| 2555 | videosync->WaitForFrame(avsync_adjustment); |
| 2556 | #else |
2549 | 2557 | videosync->WaitForFrame(0); |
| 2558 | #endif |
2550 | 2559 | if (!resetvideo) |
2551 | 2560 | { |
2552 | 2561 | videoOutput->Show(ps); |
… |
… |
void NuppelVideoPlayer::AVSync(void) |
2574 | 2583 | // If audio is way behind of video, adjust for it... |
2575 | 2584 | // by cutting the frame rate in half for the length of this frame |
2576 | 2585 | |
| 2586 | #ifdef NEW_AVSYNC |
| 2587 | avsync_adjustment = refreshrate; |
| 2588 | #else |
2577 | 2589 | avsync_adjustment = frame_interval; |
| 2590 | #endif |
2578 | 2591 | lastsync = true; |
2579 | 2592 | VERBOSE(VB_PLAYBACK, LOC + |
2580 | 2593 | QString("Video is %1 frames ahead of audio,\n" |