diff options
author | Johns <johns98@gmx.net> | 2013-01-04 18:04:53 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-01-04 18:04:53 +0100 |
commit | 1a744a8eb8bb5991c1073cf7b5884115c9659774 (patch) | |
tree | a026a4c8d4d7476ab38d6a3f8bb97f6e13dbd083 /video.c | |
parent | 78100cba002cc3da018af5717813f599f97c2630 (diff) | |
download | vdr-plugin-softhddevice-1a744a8eb8bb5991c1073cf7b5884115c9659774.tar.gz vdr-plugin-softhddevice-1a744a8eb8bb5991c1073cf7b5884115c9659774.tar.bz2 |
Sync to audio only with the first video stream.
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1398,6 +1398,7 @@ struct _vaapi_decoder_ struct timespec FrameTime; ///< time of last display VideoStream *Stream; ///< video stream int Closing; ///< flag about closing current stream + int SyncOnAudio; ///< flag sync to audio int64_t PTS; ///< video PTS clock int SyncCounter; ///< counter to sync frames @@ -5233,6 +5234,7 @@ typedef struct _vdpau_decoder_ struct timespec FrameTime; ///< time of last display VideoStream *Stream; ///< video stream int Closing; ///< flag about closing current stream + int SyncOnAudio; ///< flag sync to audio int64_t PTS; ///< video PTS clock int SyncCounter; ///< counter to sync frames @@ -5910,6 +5912,9 @@ static VdpauDecoder *VdpauNewHwDecoder(VideoStream * stream) decoder->OutputHeight = VideoWindowHeight; decoder->Stream = stream; + if (!VdpauDecoderN) { // FIXME: hack sync on audio + decoder->SyncOnAudio = 1; + } decoder->Closing = -300 - 1; decoder->PTS = AV_NOPTS_VALUE; @@ -8041,10 +8046,16 @@ static void VdpauSyncDecoder(VdpauDecoder * decoder) int64_t video_clock; err = 0; - audio_clock = AudioGetClock(); video_clock = VdpauGetClock(decoder); filled = atomic_read(&decoder->SurfacesFilled); + if (!decoder->SyncOnAudio) { + audio_clock = AV_NOPTS_VALUE; + // FIXME: 60Hz Mode + goto skip_sync; + } + audio_clock = AudioGetClock(); + // 60Hz: repeat every 5th field if (Video60HzMode && !(decoder->FramesDisplayed % 6)) { if (audio_clock == (int64_t) AV_NOPTS_VALUE |