]> git.pld-linux.org Git - packages/mplayer.git/blob - mplayer-growing-files.patch
- old live patch replaced by live555-async patch from mplayer ml (port to async RTSPC...
[packages/mplayer.git] / mplayer-growing-files.patch
1 Patch taken from:
2 http://code.google.com/p/gecko-mediaplayer/issues/detail?id=170
3 http://patches.libav.org/patch/18621/
4
5 --- mplayer/libmpdemux/demux_lavf.c.bak 2013-07-05 03:03:36.684099781 +0200
6 +++ mplayer/libmpdemux/demux_lavf.c     2013-07-05 03:04:40.447433846 +0200
7 @@ -105,8 +105,13 @@
8          pos += stream->end_pos;
9      else if(whence == SEEK_SET)
10          pos += stream->start_pos;
11 -    else if(whence == AVSEEK_SIZE && stream->end_pos > 0)
12 +    else if(whence == AVSEEK_SIZE && stream->end_pos > 0) {
13 +               off_t size;
14 +               stream_control(demuxer->stream, STREAM_CTRL_GET_SIZE, &size);
15 +                       if (size > stream->end_pos)
16 +                               stream->end_pos = size;
17          return stream->end_pos - stream->start_pos;
18 +       }
19      else
20          return -1;
21  
22 --- mplayer/stream/cache2.c.bak 2013-07-05 03:00:03.010763995 +0200
23 +++ mplayer/stream/cache2.c     2013-07-05 03:03:18.380766237 +0200
24 @@ -91,7 +91,7 @@
25    // callback
26    stream_t* stream;
27    volatile int control;
28 -  volatile unsigned control_uint_arg;
29 +  volatile uint64_t control_uint_arg;
30    volatile double control_double_arg;
31    volatile struct stream_lang_req control_lang_arg;
32    volatile int control_res;
33 @@ -264,6 +264,7 @@
34  static int cache_execute_control(cache_vars_t *s) {
35    double double_res;
36    unsigned uint_res;
37 +  unsigned uint64_res;
38    int needs_flush = 0;
39    static unsigned last;
40    int quit = s->control == -2;
41 @@ -316,6 +317,10 @@
42        s->control_res = s->stream->control(s->stream, s->control, &uint_res);
43        s->control_uint_arg = uint_res;
44        break;
45 +       case STREAM_CTRL_GET_SIZE:
46 +         s->control_res = s->stream->control(s->stream, s->control, &uint64_res);
47 +         s->control_uint_arg = uint64_res;
48 +         break;
49      case STREAM_CTRL_GET_LANG:
50        s->control_res = s->stream->control(s->stream, s->control, (void *)&s->control_lang_arg);
51        break;
52 @@ -640,6 +645,7 @@
53      case STREAM_CTRL_GET_ASPECT_RATIO:
54      case STREAM_CTRL_GET_NUM_ANGLES:
55      case STREAM_CTRL_GET_ANGLE:
56 +       case STREAM_CTRL_GET_SIZE:
57      case -2:
58        s->control = cmd;
59        break;
60 @@ -680,6 +686,9 @@
61      case STREAM_CTRL_GET_ANGLE:
62        *(unsigned *)arg = s->control_uint_arg;
63        break;
64 +       case STREAM_CTRL_GET_SIZE:
65 +         *(off_t *)arg = s->control_uint_arg;
66 +         break;
67      case STREAM_CTRL_GET_LANG:
68        *(struct stream_lang_req *)arg = s->control_lang_arg;
69        break;
This page took 0.101097 seconds and 3 git commands to generate.