Commit 2e507d45 authored by rbultje's avatar rbultje

Remove access to rdt_data struct in functions called outside of the

DynamicProtocol* context. Doing so could lead to problems if we're accessing
Real servers serving non-RDT data (or the other way around). Temporarily,
this patch adds a _subscribe2() function which will soon be removed in one
of the subsequent commits. OK'ed by Luca in "Realmedia patch" thread on ML.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15483 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b85e1d74
...@@ -234,15 +234,20 @@ ff_rdt_parse_packet(RTPDemuxContext *s, AVPacket *pkt, ...@@ -234,15 +234,20 @@ ff_rdt_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
} }
void void
ff_rdt_subscribe_rule (RTPDemuxContext *s, char *cmd, int size, ff_rdt_subscribe_rule (char *cmd, int size,
int stream_nr, int rule_nr) int stream_nr, int rule_nr)
{ {
rdt_data *rdt = s->dynamic_protocol_context;
av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d", av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d",
stream_nr, rule_nr, stream_nr, rule_nr + 1); stream_nr, rule_nr * 2, stream_nr, rule_nr * 2 + 1);
}
void
ff_rdt_subscribe_rule2 (RTPDemuxContext *s, char *cmd, int size,
int stream_nr, int rule_nr)
{
rdt_data *rdt = s->dynamic_protocol_context;
rdt_load_mdpr(rdt, s->st, 0); rdt_load_mdpr(rdt, s->st, rule_nr * 2);
} }
static unsigned char * static unsigned char *
......
...@@ -45,14 +45,16 @@ void av_register_rdt_dynamic_payload_handlers(void); ...@@ -45,14 +45,16 @@ void av_register_rdt_dynamic_payload_handlers(void);
/** /**
* Add subscription information to Subscribe parameter string. * Add subscription information to Subscribe parameter string.
* *
* @param s RDT context
* @param cmd string to write the subscription information into. * @param cmd string to write the subscription information into.
* @param size size of cmd. * @param size size of cmd.
* @param stream_nr stream number. * @param stream_nr stream number.
* @param rule_nr rule number to conform to. * @param rule_nr rule number to conform to.
*/ */
void ff_rdt_subscribe_rule(RTPDemuxContext *s, char *cmd, int size, void ff_rdt_subscribe_rule(char *cmd, int size,
int stream_nr, int rule_nr); int stream_nr, int rule_nr);
// FIXME this will be removed ASAP
void ff_rdt_subscribe_rule2(RTPDemuxContext *s, char *cmd, int size,
int stream_nr, int rule_nr);
/** /**
* Parse RDT-style packet data (header + media data). * Parse RDT-style packet data (header + media data).
......
...@@ -1324,7 +1324,8 @@ static int rtsp_read_packet(AVFormatContext *s, ...@@ -1324,7 +1324,8 @@ static int rtsp_read_packet(AVFormatContext *s,
s->filename); s->filename);
for (i = 0; i < rt->nb_rtsp_streams; i++) { for (i = 0; i < rt->nb_rtsp_streams; i++) {
if (i != 0) av_strlcat(cmd, ",", sizeof(cmd)); if (i != 0) av_strlcat(cmd, ",", sizeof(cmd));
ff_rdt_subscribe_rule( ff_rdt_subscribe_rule(cmd, sizeof(cmd), i, 0);
ff_rdt_subscribe_rule2(
rt->rtsp_streams[i]->rtp_ctx, rt->rtsp_streams[i]->rtp_ctx,
cmd, sizeof(cmd), i, 0); cmd, sizeof(cmd), i, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment