summaryrefslogtreecommitdiff
path: root/softhddev.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-01-27 23:33:10 +0100
committerJohns <johns98@gmx.net>2012-01-27 23:33:10 +0100
commitc3b924a2393c46513e5b02d5b821084d668e0bb9 (patch)
tree38062238d87024bfd51efab33aafdffe46ebc14c /softhddev.c
parentf8d198636b5291f4328d5b3f572cc084b68bda87 (diff)
downloadvdr-plugin-softhddevice-c3b924a2393c46513e5b02d5b821084d668e0bb9.tar.gz
vdr-plugin-softhddevice-c3b924a2393c46513e5b02d5b821084d668e0bb9.tar.bz2
Reduces audio latency, increases audio buffer time.
Diffstat (limited to 'softhddev.c')
-rw-r--r--softhddev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/softhddev.c b/softhddev.c
index 5abdd11..60d70c9 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -292,7 +292,6 @@ int PlayAudio(const uint8_t * data, int size,
}
avpkt->pts = AV_NOPTS_VALUE;
- AudioIncreaseBufferTime();
CodecAudioOpen(MyAudioDecoder, NULL, CODEC_ID_MP2);
AudioCodecID = CODEC_ID_MP2;
data += n;
@@ -794,11 +793,15 @@ int PlayVideo(const uint8_t * data, int size)
Debug(3, "video: not detected\n");
return size;
}
- // FIXME: incomplete packets produce artefacts after channel switch
- if (0 && VideoCodecID == CODEC_ID_MPEG2VIDEO) {
+ // incomplete packets produce artefacts after channel switch
+ // packet < 65526 is the last split packet, detect it here for
+ // better latency
+ if (size < 65526 && VideoCodecID == CODEC_ID_MPEG2VIDEO) {
// mpeg codec supports incomplete packets
// waiting for a full complete packages, increases needed delays
+ VideoEnqueue(pts, check, size - 9 - n);
VideoNextPacket(CODEC_ID_MPEG2VIDEO);
+ return size;
}
}