summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-12-13 14:43:22 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-12-13 14:43:22 +0100
commit22feb7bf1cfc0bff0742fd23657de853b63f1890 (patch)
treeb6c7434ae85cdcd507277ea622c2b5d34f0ccc23 /device.c
parent3c7d1a16aca49c647320c0ee67759007fa06a845 (diff)
downloadvdr-22feb7bf1cfc0bff0742fd23657de853b63f1890.tar.gz
vdr-22feb7bf1cfc0bff0742fd23657de853b63f1890.tar.bz2
Improved handling PES video packets with zero length when converting from TS to PES
Diffstat (limited to 'device.c')
-rw-r--r--device.c16
1 files changed, 8 insertions, 8 deletions
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;