aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-06-05 16:51:08 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-06-05 16:51:08 +0100
commit7fc1be9a01c504fb20977bb3de334a915c924244 (patch)
tree52099487586af133dfd9a0ef2ea56c10829cf8db /libavcodec
parent29c13fed68ac710a2584d31258ff9e576ee560e3 (diff)
downloadffmpeg-7fc1be9a01c504fb20977bb3de334a915c924244.tar.gz
vorbisenc: signal samples to skip
The encoder never actually signalled how many samples to skip. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vorbisenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index 489feded27..856f59048d 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -1218,6 +1218,14 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
av_free(audio);
ff_af_queue_remove(&venc->afq, frame_size, &avpkt->pts, &avpkt->duration);
+
+ if (frame_size > avpkt->duration) {
+ uint8_t *side = av_packet_new_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
+ if (!side)
+ return AVERROR(ENOMEM);
+ AV_WL32(&side[4], frame_size - avpkt->duration);
+ }
+
*got_packet_ptr = 1;
return 0;
}