summaryrefslogtreecommitdiff
path: root/libavformat/oggdec.c
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2013-09-12 10:24:18 -0700
committerMichael Niedermayer <michaelni@gmx.at>2013-09-16 21:42:41 +0200
commit23637f98f4a90a7f0413db57ddb01a4d1a82ead7 (patch)
tree48020475079225f6c1d65303299ed4430ad46f9f /libavformat/oggdec.c
parentb7dd4598630fb1f890ae060f21a9ec92a103f22d (diff)
downloadffmpeg-23637f98f4a90a7f0413db57ddb01a4d1a82ead7.tar.gz
lavf/ogg: Support for end trimming Opus
Adding support for end trimming Opus embedded in Ogg container. Signed-Off By: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r--libavformat/oggdec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 9c560a88af..9f8d665fce 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -30,6 +30,7 @@
#include <stdio.h>
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
#include "oggdec.h"
#include "avformat.h"
#include "internal.h"
@@ -773,6 +774,18 @@ retry:
pkt->duration = os->pduration;
pkt->pos = fpos;
+ if (os->end_trimming) {
+ uint8_t *side_data = av_packet_new_side_data(pkt,
+ AV_PKT_DATA_SKIP_SAMPLES,
+ 10);
+ if(side_data == NULL) {
+ av_free_packet(pkt);
+ av_free(pkt);
+ return AVERROR(ENOMEM);
+ }
+ AV_WL32(side_data + 4, os->end_trimming);
+ }
+
return psize;
}