diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-16 12:57:49 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-16 12:57:49 +0000 |
commit | c5efef7be9a088f2cf4db0d2cf4920da9fa3e0a8 (patch) | |
tree | c171d432dd936f37e5e86a8408e8ecbeb53e7d11 /libavformat/rmdec.c | |
parent | 748a4312b45ad1772713941f57aecb87a9aef20f (diff) | |
download | ffmpeg-c5efef7be9a088f2cf4db0d2cf4920da9fa3e0a8.tar.gz |
Remove packet returning in ff_rm_parse_packet() if we're using the packet
cache, since this can already be accessed through ff_rm_retrieve_cache().
See "[PATCH] rmdec.c: remove cache access duplication" thread.
Originally committed as revision 18009 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r-- | libavformat/rmdec.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 1303b9f5c4..055abf65be 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -627,16 +627,9 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, if (++(ast->sub_packet_cnt) < h) return -1; - else { ast->sub_packet_cnt = 0; rm->audio_stream_num = st->index; - rm->audio_pkt_cnt = h * w / st->codec->block_align - 1; - // Release first audio packet - av_new_packet(pkt, st->codec->block_align); - memcpy(pkt->data, ast->pkt.data, st->codec->block_align); //FIXME avoid this - *timestamp = ast->audiotimestamp; - *flags = 2; // Mark first packet as keyframe - } + rm->audio_pkt_cnt = h * w / st->codec->block_align; } else if (st->codec->codec_id == CODEC_ID_AAC) { int x; rm->audio_stream_num = st->index; @@ -644,11 +637,10 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, if (ast->sub_packet_cnt) { for (x = 0; x < ast->sub_packet_cnt; x++) ast->sub_packet_lengths[x] = get_be16(pb); - // Release first audio packet - rm->audio_pkt_cnt = ast->sub_packet_cnt - 1; - av_get_packet(pb, pkt, ast->sub_packet_lengths[0]); - *flags = 2; // Mark first packet as keyframe - } + rm->audio_pkt_cnt = ast->sub_packet_cnt; + ast->audiotimestamp = *timestamp; + } else + return -1; } else { av_get_packet(pb, pkt, len); rm_ac3_swap_bytes(st, pkt); |