From: Chris Tallon Date: Sat, 25 Mar 2006 16:03:42 +0000 (+0000) Subject: Patch for avoiding incorrect aspect switches X-Git-Tag: r0-2-2a^0 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=0e32d4e3a46c1154b9eaeb2cf0e3787dc76b8436;p=vompclient.git Patch for avoiding incorrect aspect switches --- diff --git a/demuxer.cc b/demuxer.cc index 1f553ae..be11edb 100644 --- a/demuxer.cc +++ b/demuxer.cc @@ -30,6 +30,7 @@ Demuxer::Demuxer() instance = this; initted = 0; callback = NULL; + arcnt = 0; } Demuxer::~Demuxer() @@ -113,9 +114,16 @@ void Demuxer::setAspectRatio(enum AspectRatio ar) { if (aspect_ratio != ar) { - aspect_ratio = ar; - callback->call(this); + Log::getInstance()->log("Demux", Log::DEBUG, "Aspect ratio difference signalled"); + if (++arcnt > 3) // avoid changing aspect ratio if glitch in signal + { + arcnt = 0; + aspect_ratio = ar; + callback->call(this); + } } + else + arcnt = 0; } int Demuxer::writeAudio(int fd) diff --git a/demuxer.h b/demuxer.h index 29930b5..f8e6e61 100644 --- a/demuxer.h +++ b/demuxer.h @@ -156,6 +156,7 @@ class Demuxer int horizontal_size; int vertical_size; enum AspectRatio aspect_ratio; + int arcnt; int frame_rate; int bit_rate; ULLONG video_pts;