From 22feb7bf1cfc0bff0742fd23657de853b63f1890 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 13 Dec 2008 14:43:22 +0100 Subject: Improved handling PES video packets with zero length when converting from TS to PES --- device.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'device.c') diff --git a/device.c b/device.c index 06f6864c..7d42a5eb 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 2.3 2008/07/06 13:22:21 kls Exp $ + * $Id: device.c 2.4 2008/12/13 14:30:28 kls Exp $ */ #include "device.h" @@ -1228,13 +1228,13 @@ int cDevice::PlayTsVideo(const uchar *Data, int Length) // Video PES has no explicit length, so we can only determine the end of // a PES packet when the next TS packet that starts a payload comes in: if (TsPayloadStart(Data)) { - if (const uchar *p = tsToPesVideo.GetPes(Length)) { - int w = PlayVideo(p, Length); - if (w > 0) - tsToPesVideo.Reset(); - else - return w; - } + int l; + while (const uchar *p = tsToPesVideo.GetPes(l)) { + int w = PlayVideo(p, l); + if (w < 0) + return w; + } + tsToPesVideo.Reset(); } tsToPesVideo.PutTs(Data, Length); return Length; -- cgit v1.2.3