[FFmpeg-devel] Realmedia patch
Michael Niedermayer
michaelni
Mon Sep 1 01:19:15 CEST 2008
On Sun, Aug 31, 2008 at 11:43:59AM -0400, Ronald S. Bultje wrote:
> Hi,
>
> On Sat, Aug 30, 2008 at 6:05 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> > The next few patches would then implement stream selection:
> > - ASM rulebook parsing
>
> This patch attempts to do very simplistic (as Michael requested) ASM
> rulebook parsing, it simply uses strcmp()s for the condition (first
> item in each rule). I save the condition in case at some point we want
> to allow stream changing ('a' key in ffplay), and I want to keep the
> statements around to be able to parse them and extract things like
> bitrate information for the AVStream-per-rule (this is not in the RM
> header).
[...]
> @@ -85,8 +97,24 @@
> ff_rdt_subscribe_rule (void *d, char *cmd, int size,
> int stream_nr, int rule_nr)
> {
> - av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d",
> - stream_nr, rule_nr, stream_nr, rule_nr + 1);
> + rdt_data *rdt = d;
> + int i, first = 1;
> +
> + assert(rule_nr >= 0 && rule_nr < rdt->n_rules);
> + for (i = 0; i < rdt->n_rules; i++) {
> + if (i == rule_nr ||
> + !strcmp(rdt->rule[i].condition, rdt->rule[rule_nr].condition)) {
> + if (first)
> + first = 0;
> + else
> + av_strlcat(cmd, ",", size);
> +
> + av_strlcatf(cmd, size, "stream=%d;rule=%d", stream_nr, i);
> +#ifdef ASM_RULEBOOK_DEBUG
> + printf("Subscribe to stream:%d,rule:%d\n", stream_nr, i);
> +#endif
printf() ?
also, no i do not agree to this ifdeffery
use dprintf() or whatever
[...]
> @@ -269,7 +348,9 @@
> if (av_strstart(p, "OpaqueData:buffer;", &p)) {
> rdt->mlti_data = rdt_parse_b64buf(&rdt->mlti_data_size, p);
> rdt_load_mdpr(rdt, stream, 0);
> - } else if (av_strstart(p, "StartTime:integer;", &p))
[...]
> + else if (av_strstart(p, "StartTime:integer;", &p))
cosmetic
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080901/d96fe98a/attachment.pgp>
More information about the ffmpeg-devel
mailing list