summaryrefslogtreecommitdiff
path: root/codec.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2011-12-14 18:01:03 +0100
committerJohns <johns98@gmx.net>2011-12-14 18:01:03 +0100
commit5ca9bedda810e84b7bc1dc476c39c817563ad353 (patch)
tree5d67f42322eee373436c221867f78a87dada9f73 /codec.c
parent4bd1d0ba3f19e7aa7119ed7d6fbcd4cd91b5f47a (diff)
downloadvdr-plugin-softhddevice-5ca9bedda810e84b7bc1dc476c39c817563ad353.tar.gz
vdr-plugin-softhddevice-5ca9bedda810e84b7bc1dc476c39c817563ad353.tar.bz2
Initial support of replay.
Diffstat (limited to 'codec.c')
-rw-r--r--codec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/codec.c b/codec.c
index 52e79bd..82fcef2 100644
--- a/codec.c
+++ b/codec.c
@@ -567,28 +567,29 @@ void CodecAudioDecode(AudioDecoder * audio_decoder, AVPacket * avpkt)
Fatal(_("codec: internal error parser freeded while running\n"));
}
#define spkt avpkt
-#if 0
+#if 0 // didn't fix crash in av_parser_parse2
AVPacket spkt[1];
- if (av_new_packet(spkt, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE)) {
+ // av_new_packet reserves FF_INPUT_BUFFER_PADDING_SIZE and clears it
+ if (av_new_packet(spkt, avpkt->size)) {
Error(_("codec: out of memory\n"));
return;
}
memcpy(spkt->data, avpkt->data, avpkt->size);
- memset(spkt->data + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
spkt->pts = avpkt->pts;
+ spkt->dts = avpkt->dts;
#endif
audio_ctx = audio_decoder->AudioCtx;
index = 0;
- while (avpkt->size > index) {
+ while (spkt->size > index) {
int n;
int l;
AVPacket dpkt[1];
av_init_packet(dpkt);
n = av_parser_parse2(audio_decoder->AudioParser, audio_ctx,
- &dpkt->data, &dpkt->size, spkt->data + index, avpkt->size - index,
+ &dpkt->data, &dpkt->size, spkt->data + index, spkt->size - index,
!index ? (uint64_t) spkt->pts : AV_NOPTS_VALUE, AV_NOPTS_VALUE,
-1);