summaryrefslogtreecommitdiff
path: root/softhddev.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-01-22 17:18:18 +0100
committerJohns <johns98@gmx.net>2013-01-22 17:18:18 +0100
commitcd82ee8e4a01e29cc9aa616ba9a68c5c59e11d89 (patch)
treeec9ff5c7295c5006f6d29a5a02cbbc0d496f96f9 /softhddev.c
parenta1f17199d6589255975389773ec0613f4d0b8edc (diff)
downloadvdr-plugin-softhddevice-cd82ee8e4a01e29cc9aa616ba9a68c5c59e11d89.tar.gz
vdr-plugin-softhddevice-cd82ee8e4a01e29cc9aa616ba9a68c5c59e11d89.tar.bz2
Fix bug: no sound with video output "none".
Diffstat (limited to 'softhddev.c')
-rw-r--r--softhddev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/softhddev.c b/softhddev.c
index e10aed8..3d6f021 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -51,7 +51,7 @@
#include "codec.h"
#ifdef DEBUG
-static int H264Dump(const uint8_t * data, int size);
+static int DumpH264(const uint8_t * data, int size);
static void DumpMpeg(const uint8_t * data, int size);
#endif
@@ -989,8 +989,8 @@ int PlayAudio(const uint8_t * data, int size, uint8_t id)
return 0;
}
// soft limit buffer full
- if (AudioUsedBytes() > AUDIO_MIN_BUFFER_FREE && (!AudioSyncStream
- || VideoGetBuffers(AudioSyncStream) > 3)) {
+ if (AudioSyncStream && VideoGetBuffers(AudioSyncStream) > 3
+ && AudioUsedBytes() > AUDIO_MIN_BUFFER_FREE) {
return 0;
}
// PES header 0x00 0x00 0x01 ID
@@ -1213,8 +1213,8 @@ int PlayTsAudio(const uint8_t * data, int size)
return 0;
}
// soft limit buffer full
- if (AudioUsedBytes() > AUDIO_MIN_BUFFER_FREE && (!AudioSyncStream
- || VideoGetBuffers(AudioSyncStream) > 3)) {
+ if (AudioSyncStream && VideoGetBuffers(AudioSyncStream) > 3
+ && AudioUsedBytes() > AUDIO_MIN_BUFFER_FREE) {
return 0;
}
@@ -1427,7 +1427,7 @@ static void VideoNextPacket(VideoStream * stream, int codec_id)
memset(avpkt->data + avpkt->stream_index, 0, FF_INPUT_BUFFER_PADDING_SIZE);
avpkt->priv = (void *)(size_t) codec_id;
- //H264Dump(avpkt->data, avpkt->stream_index);
+ //DumpH264(avpkt->data, avpkt->stream_index);
// advance packet write
stream->PacketWrite = (stream->PacketWrite + 1) % VIDEO_PACKET_MAX;
@@ -1939,7 +1939,7 @@ static void DumpMpeg(const uint8_t * data, int size)
**
** Function to Dump a h264 packet, not needed.
*/
-static int H264Dump(const uint8_t * data, int size)
+static int DumpH264(const uint8_t * data, int size)
{
printf("H264:");
do {
@@ -2057,9 +2057,8 @@ int PlayVideo3(VideoStream * stream, const uint8_t * data, int size)
return 0;
}
// soft limit buffer full
- if (atomic_read(&stream->PacketsFilled) > 3
+ if (AudioSyncStream == stream && atomic_read(&stream->PacketsFilled) > 3
&& AudioUsedBytes() > AUDIO_MIN_BUFFER_FREE) {
- // FIXME: audio only for main video stream
return 0;
}
// get pts/dts
@@ -2580,6 +2579,7 @@ int Poll(int timeout)
int filled;
used = AudioUsedBytes();
+ // FIXME: no video!
filled = atomic_read(&MyVideoStream->PacketsFilled);
// soft limit + hard limit
full = (used > AUDIO_MIN_BUFFER_FREE && filled > 3)