# HG changeset patch # User rbultje # Date 1230443903 0 # Node ID fd0fc1e26d82fce0048c89e0b3a107e910e9a970 # Parent d74875f9b3d4cfe1bcb93cc3ee500d18473943ab Add audio_pkt_cnt return value to ff_rm_retrieve_cache(). See discussion in "[PATCH] oops I broke rdt.c" mailinglist thread. diff -r d74875f9b3d4 -r fd0fc1e26d82 rdt.c --- a/rdt.c Sun Dec 28 05:55:09 2008 +0000 +++ b/rdt.c Sun Dec 28 05:58:23 2008 +0000 @@ -315,6 +315,7 @@ NULL, NULL, NULL, NULL); } } else { + rdt->audio_pkt_cnt = ff_rm_retrieve_cache (rdt->rmctx, rdt->rmctx->pb, st, rdt->rmst[0], pkt); if (rdt->audio_pkt_cnt == 0 && st->codec->codec_id == CODEC_ID_AAC) diff -r d74875f9b3d4 -r fd0fc1e26d82 rm.h --- a/rm.h Sun Dec 28 05:55:09 2008 +0000 +++ b/rm.h Sun Dec 28 05:58:23 2008 +0000 @@ -83,8 +83,10 @@ * @param st stream that this packet belongs to * @param rst Real-specific stream information * @param pkt location to store the packet data + * @returns the number of samples left for subsequent calls to this same + * function, or 0 if all samples have been retrieved. */ -void ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb, +int ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb, AVStream *st, RMStream *rst, AVPacket *pkt); #endif /* AVFORMAT_RM_H */ diff -r d74875f9b3d4 -r fd0fc1e26d82 rmdec.c --- a/rmdec.c Sun Dec 28 05:55:09 2008 +0000 +++ b/rmdec.c Sun Dec 28 05:58:23 2008 +0000 @@ -681,7 +681,7 @@ return st->codec->codec_type == CODEC_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; } -void +int ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb, AVStream *st, RMStream *ast, AVPacket *pkt) { @@ -700,6 +700,8 @@ rm->audio_pkt_cnt--; pkt->flags = 0; pkt->stream_index = st->index; + + return rm->audio_pkt_cnt; } static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)