1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

amr: Set the pkt->pos field properly to the start of the packet

Previously, the field pointed to the second byte of the packet
(which is the first byte of the actual AMR payload).
This commit is contained in:
Martin Storsjö 2011-02-09 12:16:51 +02:00 committed by Luca Barbato
parent 2890cba8b5
commit 026fa81de4

View File

@ -121,6 +121,7 @@ static int amr_read_packet(AVFormatContext *s,
{
AVCodecContext *enc = s->streams[0]->codec;
int read, size = 0, toc, mode;
int64_t pos = avio_tell(s->pb);
if (s->pb->eof_reached)
{
@ -157,7 +158,7 @@ static int amr_read_packet(AVFormatContext *s,
s->streams[0]->codec->bit_rate = size*8*50;
pkt->stream_index = 0;
pkt->pos= avio_tell(s->pb);
pkt->pos = pos;
pkt->data[0]=toc;
pkt->duration= enc->codec_id == CODEC_ID_AMR_NB ? 160 : 320;
read = avio_read(s->pb, pkt->data+1, size-1);