summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-08-30 11:48:45 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-08-30 11:48:45 +0200
commit7a64aeec74d48af456074d569c9405c4889f44d5 (patch)
tree9d7b02d323b166df52ad4695df5615f7621cb01b
parentd07ae214f939169b3268fcfb7537c4c72d42dd1f (diff)
downloadvdr-7a64aeec74d48af456074d569c9405c4889f44d5.tar.gz
vdr-7a64aeec74d48af456074d569c9405c4889f44d5.tar.bz2
Fixed displaying still pictures, now using the driver's VIDEO_STILLPICTURE call directly
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY3
-rw-r--r--dvbdevice.c46
3 files changed, 47 insertions, 4 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 65d44f7e..068a7b8a 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -489,6 +489,8 @@ Oliver Endriss <o.endriss@gmx.de>
the remote control keys
for reporting a bug in reading 'epg.data' for channels with non-zero RID
for fixing I/O handling in case an explicit controlling terminal is given
+ for fixing displaying still pictures, now using the driver's VIDEO_STILLPICTURE call
+ directly
Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf'
diff --git a/HISTORY b/HISTORY
index 3baafa69..01c4d77a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2341,3 +2341,6 @@ Video Disk Recorder Revision History
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.
diff --git a/dvbdevice.c b/dvbdevice.c
index 65ae43b6..19be0223 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:49:53 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
+ <o.endriss@gmx.de> 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--) {