From e4b016980bb7c2f0bb369f64b2ac411500865b32 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 31 Aug 2003 18:00:00 +0200 Subject: Version 1.2.5pre1 - Now explicitly handling exit value 0 and 2 in 'runvdr'. - Added a missing 'w' to the allowed characters for Finnish and Swedish (thanks to Lauri Tischler and Ragnar Sundblad). - Added channels for DVB-T Hannover (Germany) to channels.cont.terr (thanks to Peter Waechtler). - Fixed a hangup in SVDRP when the client disappears without sending QUIT (thanks to Robert Bartl for reporting this one). The problem was introduced in version 1.2.2 through the fix for an occasional "Broken pipe" error in SVDRP connections. - Updated 'channels.conf.terr' for Berlin. - Fixed displaying still pictures, now using the driver's VIDEO_STILLPICTURE call directly (thanks to Oliver Endriss). This also improves navigating through DVD menus with the DVD plugin. If this causes problems with your particular system (maybe because you are using the 'analogtv' plugin) you can reactivate the previous behaviour by commenting out the line #define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES in VDR/dvbdevice.c. Note that you need driver version 2003-08-23 or later for this to work! - Fixed handling extra blanks in plugin command lines. - Actually implemented the SVDRP command DELC. - Now clearing the player device if there are too many poll timeouts in 'Transfer Mode', which avoids buffer overflows and black screens in such cases. --- dvbdevice.c | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'dvbdevice.c') diff --git a/dvbdevice.c b/dvbdevice.c index fe6c951..19be022 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.62 2003/08/24 14:23:12 kls Exp $ + * $Id: dvbdevice.c 1.63 2003/08/30 11:40:41 kls Exp $ */ #include "dvbdevice.h" @@ -896,11 +896,49 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length) If anybody ever finds out what could be changed so that VIDEO_STILLPICTURE could be used, please let me know! kls 2002-03-23 + 2003-08-30: apparently the driver can't handle PES data, so Oliver Endriss + has changed this to strip all PES headers + and send pure ES data to the driver. Seems to work just fine! + Let's drop the VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES stuff + once this has proven to work in all cases. */ -//#define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES +#define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES #ifdef VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES - video_still_picture sp = { (char *)Data, Length }; - CHECK(ioctl(fd_video, VIDEO_STILLPICTURE, &sp)); + if (Data[0] == 0x00 && Data[1] == 0x00 && Data[2] == 0x01 && (Data[3] & 0xF0) == 0xE0) { + // PES data + char *buf = MALLOC(char, Length); + if (!buf) + return; + int i = 0; + int blen = 0; + while (i < Length - 4) { + if (Data[i] == 0x00 && Data[i + 1] == 0x00 && Data[i + 2] == 0x01 && (Data[i + 3] & 0xF0) == 0xE0) { + // skip PES header + int offs = i + 6; + int len = Data[i + 4] * 256 + Data[i + 5]; + // skip header extension + if ((Data[i + 6] & 0xC0) == 0x80) { + offs += 3; + offs += Data[i + 8]; + len -= 3; + len -= Data[i + 8]; + } + memcpy(&buf[blen], &Data[offs], len); + i = offs + len; + blen += len; + } + else + i++; + } + video_still_picture sp = { buf, blen }; + CHECK(ioctl(fd_video, VIDEO_STILLPICTURE, &sp)); + free(buf); + } + else { + // non-PES data + video_still_picture sp = { (char *)Data, Length }; + CHECK(ioctl(fd_video, VIDEO_STILLPICTURE, &sp)); + } #else #define MIN_IFRAME 400000 for (int i = MIN_IFRAME / Length + 1; i > 0; i--) { -- cgit v1.2.3