|
|
|
@ -105,7 +105,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt |
|
|
|
|
int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), |
|
|
|
|
int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *)) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
int i, ret; |
|
|
|
|
|
|
|
|
|
if (pkt) { |
|
|
|
|
AVStream *st = s->streams[pkt->stream_index]; |
|
|
|
@ -119,12 +119,10 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt |
|
|
|
|
} |
|
|
|
|
av_fifo_generic_write(aic->fifo, pkt->data, pkt->size, NULL); |
|
|
|
|
} else { |
|
|
|
|
int ret; |
|
|
|
|
// rewrite pts and dts to be decoded time line position
|
|
|
|
|
pkt->pts = pkt->dts = aic->dts; |
|
|
|
|
aic->dts += pkt->duration; |
|
|
|
|
ret = ff_interleave_add_packet(s, pkt, compare_ts); |
|
|
|
|
if (ret < 0) |
|
|
|
|
if ((ret = ff_interleave_add_packet(s, pkt, compare_ts)) < 0) |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
pkt = NULL; |
|
|
|
@ -134,10 +132,8 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt |
|
|
|
|
AVStream *st = s->streams[i]; |
|
|
|
|
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
|
|
|
AVPacket new_pkt; |
|
|
|
|
int ret; |
|
|
|
|
while ((ret = interleave_new_audio_packet(s, &new_pkt, i, flush)) > 0) { |
|
|
|
|
ret = ff_interleave_add_packet(s, &new_pkt, compare_ts); |
|
|
|
|
if (ret < 0) |
|
|
|
|
if ((ret = ff_interleave_add_packet(s, &new_pkt, compare_ts)) < 0) |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
if (ret < 0) |
|
|
|
|