diff options
author | Johns <johns98@gmx.net> | 2012-02-24 15:22:26 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-02-24 15:22:26 +0100 |
commit | 07b426f2b5889ddd8fd020302c1ad2c2e7f581b5 (patch) | |
tree | 95745d1fa6e23550e1ad6bf35224a99d2f9180c2 /softhddev.c | |
parent | 668a6ec2775eb7d88df3db6d89d2e2faceb89289 (diff) | |
download | vdr-plugin-softhddevice-07b426f2b5889ddd8fd020302c1ad2c2e7f581b5.tar.gz vdr-plugin-softhddevice-07b426f2b5889ddd8fd020302c1ad2c2e7f581b5.tar.bz2 |
Fix bug in new audio ts parser: hangup.
Diffstat (limited to 'softhddev.c')
-rw-r--r-- | softhddev.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/softhddev.c b/softhddev.c index a49b103..1ae550c 100644 --- a/softhddev.c +++ b/softhddev.c @@ -474,6 +474,13 @@ void PesParse(PesDemux * pesdx, const uint8_t * data, int size, int is_start) pesdx->PTS = AV_NOPTS_VALUE; // reset if not yet used pesdx->DTS = AV_NOPTS_VALUE; } + // cleanup, if too much cruft + if (pesdx->Skip > PES_MAX_PAYLOAD / 2) { + // copy remaining bytes down + pesdx->Index -= pesdx->Skip; + memmove(pesdx->Buffer, pesdx->Buffer + pesdx->Skip, pesdx->Index); + pesdx->Skip = 0; + } p = data; do { @@ -1001,6 +1008,11 @@ int PlayAudio(const uint8_t * data, int size, uint8_t id) if ((id == 0xbd || (id & 0xF0) == 0x80) && !r && FastAc3Check(p)) { r = Ac3Check(p, n); codec_id = CODEC_ID_AC3; + /* faster ac3 detection at end of pes packet (no improvemnts) + if (AudioCodecID == codec_id && -r - 2 == n) { + r = n; + } + */ } if (r < 0) { // need more bytes break; @@ -1067,6 +1079,7 @@ int PlayTsAudio(const uint8_t * data, int size) if (NewAudioStream) { // FIXME: does this clear the audio ringbuffer? CodecAudioClose(MyAudioDecoder); + AudioSetBufferTime(216); AudioCodecID = CODEC_ID_NONE; NewAudioStream = 0; PesReset(PesDemuxAudio); @@ -1828,12 +1841,14 @@ uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height) /** ** Set play mode, called on channel switch. +** +** @param play_mode play mode (none, video+audio, audio-only, ...) */ int SetPlayMode(int play_mode) { if (ConfigStartSuspended) { // ignore first call, if start suspended ConfigStartSuspended = 0; - return; + return 1; } Resume(); VideoDisplayWakeup(); |