Magellan Linux

Contents of /trunk/mplayer/patches/mplayer-1.0_rc1-asmrules_fix_20061231.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years ago) by niro
File size: 1450 byte(s)
-import

1 Index: stream/realrtsp/asmrp.c
2 ===================================================================
3 --- stream/realrtsp/asmrp.c (revision 20381)
4 +++ stream/realrtsp/asmrp.c (working copy)
5 @@ -40,6 +40,7 @@
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <string.h>
9 +#include "asmrp.h"
10
11 /*
12 #define LOG
13 @@ -645,8 +646,10 @@
14 #ifdef LOG
15 printf ("rule #%d is true\n", rule_num);
16 #endif
17 - matches[num_matches] = rule_num;
18 - num_matches++;
19 + if(num_matches < MAX_RULEMATCHES - 1)
20 + matches[num_matches++] = rule_num;
21 + else
22 + printf("Ignoring matched asm rule %d, too many matched rules.\n", rule_num);
23 }
24
25 rule_num++;
26 Index: stream/realrtsp/real.c
27 ===================================================================
28 --- stream/realrtsp/real.c (revision 20381)
29 +++ stream/realrtsp/real.c (working copy)
30 @@ -271,7 +271,7 @@
31 int j=0;
32 int n;
33 char b[64];
34 - int rulematches[16];
35 + int rulematches[MAX_RULEMATCHES];
36
37 #ifdef LOG
38 printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth);
39 Index: stream/realrtsp/asmrp.h
40 ===================================================================
41 --- stream/realrtsp/asmrp.h (revision 20381)
42 +++ stream/realrtsp/asmrp.h (working copy)
43 @@ -40,6 +40,8 @@
44 #ifndef HAVE_ASMRP_H
45 #define HAVE_ASMRP_H
46
47 +#define MAX_RULEMATCHES 16
48 +
49 int asmrp_match (const char *rules, int bandwidth, int *matches) ;
50
51 #endif