diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2008-12-28 00:21:11 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2008-12-28 00:21:11 +0000 |
commit | 886e89d0d05ad99064e9d739e9b26beb71d79f29 (patch) | |
tree | 587175b6ad5a05034a70959fd7a5e15717294a5d /libavformat/rdt.c | |
parent | ba61472911a637bbf395c345b051c0a15aae6b56 (diff) | |
download | ffmpeg-886e89d0d05ad99064e9d739e9b26beb71d79f29.tar.gz |
Add RMStream object as function argument to public functions so that non-.rm
AVStreams can be used to call these public rmdec.c functions as well, as is
the case for RDT/RTSP streams. See mailinglist discussion in "[PATCH] rdt.c:
don't reuse the same AVStream in both RTSP and RM demuxer" thread.
Originally committed as revision 16366 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rdt.c')
-rw-r--r-- | libavformat/rdt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c index be35cd02d5..e90b565f90 100644 --- a/libavformat/rdt.c +++ b/libavformat/rdt.c @@ -81,6 +81,7 @@ ff_rdt_parse_close(RDTDemuxContext *s) struct PayloadContext { AVFormatContext *rmctx; + RMStream *rmst[MAX_STREAMS]; uint8_t *mlti_data; unsigned int mlti_data_size; char buffer[RTP_MAX_PACKET_LENGTH + FF_INPUT_BUFFER_PADDING_SIZE]; @@ -174,7 +175,7 @@ rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr) size = rdt->mlti_data_size; url_fseek(&pb, 0, SEEK_SET); } - if (ff_rm_read_mdpr_codecdata(rdt->rmctx, &pb, st, size) < 0) + if (ff_rm_read_mdpr_codecdata(rdt->rmctx, &pb, st, rdt->rmst[0], size) < 0) return -1; return 0; @@ -301,7 +302,7 @@ rdt_parse_packet (PayloadContext *rdt, AVStream *st, init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL); flags = (flags & PKT_FLAG_KEY) ? 2 : 0; - res = ff_rm_parse_packet (rdt->rmctx, &pb, st, len, pkt, + res = ff_rm_parse_packet (rdt->rmctx, &pb, st, rdt->rmst[0], len, pkt, &seq, &flags, timestamp); pos = url_ftell(&pb); if (res < 0) @@ -314,7 +315,7 @@ rdt_parse_packet (PayloadContext *rdt, AVStream *st, NULL, NULL, NULL, NULL); } } else { - ff_rm_retrieve_cache (rdt->rmctx, rdt->rmctx->pb, st, pkt); + ff_rm_retrieve_cache (rdt->rmctx, rdt->rmctx->pb, st, rdt->rmst[0], pkt); if (rdt->audio_pkt_cnt[st->id] == 0 && st->codec->codec_id == CODEC_ID_AAC) av_freep(&rdt->rmctx->pb); @@ -426,6 +427,7 @@ rdt_new_extradata (void) PayloadContext *rdt = av_mallocz(sizeof(PayloadContext)); av_open_input_stream(&rdt->rmctx, NULL, "", &rdt_demuxer, NULL); + rdt->rmst[0] = ff_rm_alloc_rmstream(); return rdt; } @@ -433,6 +435,7 @@ rdt_new_extradata (void) static void rdt_free_extradata (PayloadContext *rdt) { + ff_rm_free_rmstream(rdt->rmst[0]); if (rdt->rmctx) av_close_input_stream(rdt->rmctx); av_freep(&rdt->mlti_data); |