[vdr-plugin-softhddevice] 01/04: Imported Upstream version 0.6.0+git20150212

Tobias Grimm tiber-guest at moszumanska.debian.org
Thu Feb 12 20:37:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-softhddevice.

commit cb435195558c7c9421e5df48baa169e3240fb499
Author: etobi <git at e-tobi.net>
Date:   Thu Feb 12 21:31:14 2015 +0100

    Imported Upstream version 0.6.0+git20150212
---
 ChangeLog        |  7 +++++++
 softhddevice.cpp |  4 ++--
 video.c          | 29 ++++++++++++++++++++++++-----
 3 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79bf45a..6538b99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+User johns
+Date:
+
+    Compile with vdr 2.1.10.
+    Fix bug: AVCodecContext.framerate not supported.
+    Use video stream frame rate for A/V sync.
+
 User Antti Sepp�l�
 Date: Thu Oct 16 14:15:15 CEST 2014
 
diff --git a/softhddevice.cpp b/softhddevice.cpp
index b3467a5..eb07e48 100644
--- a/softhddevice.cpp
+++ b/softhddevice.cpp
@@ -496,7 +496,7 @@ void cSoftOsd::Flush(void)
     }
 
     LOCK_PIXMAPS;
-    while ((pm = RenderPixmaps())) {
+    while ((pm = (dynamic_cast < cPixmapMemory * >(RenderPixmaps())))) {
 	int x;
 	int y;
 	int w;
@@ -513,7 +513,7 @@ void cSoftOsd::Flush(void)
 #endif
 	OsdDrawARGB(x, y, w, h, pm->Data());
 
-	delete pm;
+	DestroyPixmap(pm);
     }
     Dirty = 0;
 }
diff --git a/video.c b/video.c
index 7f47f5e..56cae36 100644
--- a/video.c
+++ b/video.c
@@ -446,13 +446,32 @@ static void VideoThreadExit(void);	///< exit/kill video thread
 ///
 ///	@note frame->interlaced_frame can't be used for interlace detection
 ///
-static void VideoSetPts(int64_t * pts_p, int interlaced, const AVFrame * frame)
+static void VideoSetPts(int64_t * pts_p, int interlaced,
+    const AVCodecContext * video_ctx, const AVFrame * frame)
 {
     int64_t pts;
+    int duration;
+
+    //
+    //	Get duration for this frame.
+    //	FIXME: using framerate as workaround for av_frame_get_pkt_duration
+    //
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56,13,100)
+    // FIXME: need frame rate for older versions
+    duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default
+#else
+    if (video_ctx->framerate.num != 0 && video_ctx->framerate.den != 0) {
+	duration = 1000 * video_ctx->framerate.den / video_ctx->framerate.num;
+    } else {
+	duration = interlaced ? 40 : 20;	// 50Hz -> 20ms default
+    }
+    Debug(4, "video: %d/%d %" PRIx64 " -> %d\n", video_ctx->framerate.den,
+	video_ctx->framerate.num, av_frame_get_pkt_duration(frame), duration);
+#endif
 
     // update video clock
     if (*pts_p != (int64_t) AV_NOPTS_VALUE) {
-	*pts_p += interlaced ? 40 * 90 : 20 * 90;
+	*pts_p += duration * 90;
 	//Info("video: %s +pts\n", Timestamp2String(*pts_p));
     }
     //av_opt_ptr(avcodec_get_frame_class(), frame, "best_effort_timestamp");
@@ -5257,7 +5276,7 @@ static void VaapiSyncRenderFrame(VaapiDecoder * decoder,
     }
 
     if (!decoder->Closing) {
-	VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
+	VideoSetPts(&decoder->PTS, decoder->Interlaced, video_ctx, frame);
     }
     VaapiRenderFrame(decoder, video_ctx, frame);
 #ifdef USE_AUTOCROP
@@ -8879,7 +8898,7 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
 
     if (VdpauPreemption) {		// display preempted
 	if (!decoder->Closing) {
-	    VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
+	    VideoSetPts(&decoder->PTS, decoder->Interlaced, video_ctx, frame);
 	}
 	return;
     }
@@ -8929,7 +8948,7 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
 #endif
 
     if (!decoder->Closing) {
-	VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
+	VideoSetPts(&decoder->PTS, decoder->Interlaced, video_ctx, frame);
     }
     VdpauRenderFrame(decoder, video_ctx, frame);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-softhddevice.git



More information about the pkg-vdr-dvb-changes mailing list