diff options
author | Johns <johns98@gmx.net> | 2012-03-03 16:11:38 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-03-03 16:11:38 +0100 |
commit | dda9011abc273d28815f2837d5ef19c385601873 (patch) | |
tree | 19f929252d32a00a145ea029b158a6d85a4b0b51 | |
parent | de79e9211f5efcab225f750d9bdd85da3c9d83ac (diff) | |
download | vdr-plugin-softhddevice-dda9011abc273d28815f2837d5ef19c385601873.tar.gz vdr-plugin-softhddevice-dda9011abc273d28815f2837d5ef19c385601873.tar.bz2 |
Removes LPCM detection from TS parser.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | softhddev.c | 19 |
2 files changed, 17 insertions, 3 deletions
@@ -1,6 +1,7 @@ User johns Date: + Removes LPCM detection from TS parser. Rewrote video/audio start code. Add support for attach/detach plugin. OSS needs bigger audio buffers. diff --git a/softhddev.c b/softhddev.c index d875417..232ab0d 100644 --- a/softhddev.c +++ b/softhddev.c @@ -492,6 +492,8 @@ void PesParse(PesDemux * pesdx, const uint8_t * data, int size, int is_start) return; case PES_START: // at start of pes packet payload +#if 0 + // Played with PlayAudio // FIXME: need 0x80 -- 0xA0 state if (AudioCodecID == CODEC_ID_NONE) { if ((*p & 0xF0) == 0x80) { // AC-3 & DTS @@ -501,9 +503,11 @@ void PesParse(PesDemux * pesdx, const uint8_t * data, int size, int is_start) pesdx->State = PES_LPCM_HEADER; pesdx->HeaderIndex = 0; pesdx->HeaderSize = 7; - break; + // FIXME: need harder LPCM check + //break; } } +#endif case PES_INIT: // find start of audio packet // FIXME: increase if needed the buffer @@ -1082,6 +1086,7 @@ int PlayTsAudio(const uint8_t * data, int size) if (NewAudioStream) { // FIXME: does this clear the audio ringbuffer? CodecAudioClose(MyAudioDecoder); + // max time between audio packets 200ms + 24ms hw buffer AudioSetBufferTime(264); AudioCodecID = CODEC_ID_NONE; NewAudioStream = 0; @@ -1349,10 +1354,18 @@ int VideoDecode(void) return -1; } #if 0 + int f; + // FIXME: flush buffers, if close is in the queue - while (filled) { - avpkt = &VideoPacketRb[VideoPacketRead]; + for (f = 0; f < filled; ++f) { + avpkt = &VideoPacketRb[(VideoPacketRead + f) % VIDEO_PACKET_MAX]; if ((int)(size_t) avpkt->priv == CODEC_ID_NONE) { + printf("video: close\n"); + if (f) { + atomic_sub(f, &VideoPacketsFilled); + VideoPacketRead = (VideoPacketRead + f) % VIDEO_PACKET_MAX; + } + break; } } #endif |