1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed cDevice::PlayTsAudio() and made cDevice::PlayTsVideo() return 0 if PlayVideo() didn't play anything

This commit is contained in:
Klaus Schmidinger 2009-01-24 11:20:24 +01:00
parent 2b174b07bd
commit c2ecee3d40
2 changed files with 14 additions and 17 deletions

View File

@ -5912,7 +5912,7 @@ Video Disk Recorder Revision History
can handle DVB-S2. The #define is still there to allow people with older drivers
who don't need DVB-S2 to use this version without pathcing.
2009-01-23: Version 1.7.4
2009-01-24: Version 1.7.4
- Removed the '#define FE_CAN_2ND_GEN_MODULATION', since it was wrong and the
flag is now in the driver, anyway.
@ -5954,3 +5954,5 @@ Video Disk Recorder Revision History
packets (suggested by Frank Schmirler).
- Changed cPatPmtGenerator to make sure the PMT pid doesn't collide with any of
the actual pids of the channel.
- Fixed cDevice::PlayTsAudio() and made cDevice::PlayTsVideo() return 0 if
PlayVideo() didn't play anything.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 2.8 2009/01/23 16:02:21 kls Exp $
* $Id: device.c 2.9 2009/01/24 11:16:31 kls Exp $
*/
#include "device.h"
@ -1273,7 +1273,7 @@ int cDevice::PlayTsVideo(const uchar *Data, int Length)
int l;
while (const uchar *p = tsToPesVideo.GetPes(l)) {
int w = PlayVideo(p, l);
if (w < 0)
if (w <= 0)
return w;
}
tsToPesVideo.Reset();
@ -1284,20 +1284,15 @@ int cDevice::PlayTsVideo(const uchar *Data, int Length)
int cDevice::PlayTsAudio(const uchar *Data, int Length)
{
bool PayloadStart = TsPayloadStart(Data);
for (int Pass = 0; Pass < 2; Pass++) {
if (Pass == 0 && !PayloadStart) // if no new payload is started, we can always put the packet into the converter
tsToPesAudio.PutTs(Data, Length);
if (const uchar *p = tsToPesAudio.GetPes(Length)) {
int w = PlayAudio(p, Length, 0);
if (w > 0)
// Audio PES always has an explicit length and consists of single packets:
int l;
if (const uchar *p = tsToPesAudio.GetPes(l)) {
int w = PlayAudio(p, l, 0);
if (w <= 0)
return w;
tsToPesAudio.Reset();
else if (PayloadStart)
return w; // must get out the old packet before starting a new one
}
if (Pass == 0 && PayloadStart)
tsToPesAudio.PutTs(Data, Length);
}
return Length;
}