aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rdt.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-02-11 23:36:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-02-13 00:54:05 +0100
commitae9c5ea2addf54a4b5d0a39f0728801e55226dfa (patch)
treeba51bcf9b7e5d1732e1d113da5ac5b2d2fe65b6d /libavformat/rdt.c
parentb7195837cddc22dc41078c77e5c37928eec116f8 (diff)
downloadffmpeg-ae9c5ea2addf54a4b5d0a39f0728801e55226dfa.tar.gz
rtsp/rdt: Assign the RTSPStream index to AVStream->id
This is used for mapping AVStreams back to their corresponding RTSPStream. Since d9c0510, the RTSPStream pointer isn't stored in AVStream->priv_data any longer, breaking this mapping from AVStreams to RTSPStreams. Also, we don't need to clear the priv_data in rdt cleanup any longer, since it isn't set to duplicate pointers. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit b2dd842d21a0b441bb9f7092357f479beb6b6f69)
Diffstat (limited to 'libavformat/rdt.c')
-rw-r--r--libavformat/rdt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index bb7f278163..a9bf476276 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -63,7 +63,7 @@ ff_rdt_parse_open(AVFormatContext *ic, int first_stream_of_set_idx,
do {
s->n_streams++;
} while (first_stream_of_set_idx + s->n_streams < ic->nb_streams &&
- s->streams[s->n_streams]->priv_data == s->streams[0]->priv_data);
+ s->streams[s->n_streams]->id == s->streams[0]->id);
s->prev_set_id = -1;
s->prev_stream_id = -1;
s->prev_timestamp = -1;
@@ -76,11 +76,6 @@ ff_rdt_parse_open(AVFormatContext *ic, int first_stream_of_set_idx,
void
ff_rdt_parse_close(RDTDemuxContext *s)
{
- int i;
-
- for (i = 1; i < s->n_streams; i++)
- s->streams[i]->priv_data = NULL;
-
av_free(s);
}
@@ -422,7 +417,7 @@ rdt_parse_sdp_line (AVFormatContext *s, int st_index,
int n, first = -1;
for (n = 0; n < s->nb_streams; n++)
- if (s->streams[n]->priv_data == stream->priv_data) {
+ if (s->streams[n]->id == stream->id) {
int count = s->streams[n]->index + 1;
if (first == -1) first = n;
if (rdt->nb_rmst < count) {
@@ -463,10 +458,9 @@ add_dstream(AVFormatContext *s, AVStream *orig_st)
{
AVStream *st;
- if (!(st = av_new_stream(s, 0)))
+ if (!(st = av_new_stream(s, orig_st->id)))
return NULL;
st->codec->codec_type = orig_st->codec->codec_type;
- st->priv_data = orig_st->priv_data;
st->first_dts = orig_st->first_dts;
return st;