Browse code

Merge commit '5afe1d27912be9b643ffb4ddc21f6d920260dbb0'

* commit '5afe1d27912be9b643ffb4ddc21f6d920260dbb0':
avio: Add const qualifiers to ffio_read_indirect

Conflicts:
libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/08/08 19:04:46
Showing 3 changed files
... ...
@@ -52,7 +52,7 @@ int ffio_init_context(AVIOContext *s,
52 52
  *    will be a copy of buf
53 53
  * @return number of bytes read or AVERROR
54 54
  */
55
-int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data);
55
+int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data);
56 56
 
57 57
 /**
58 58
  * Read size bytes from AVIOContext into buf.
... ...
@@ -525,7 +525,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
525 525
     return size1 - size;
526 526
 }
527 527
 
528
-int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data)
528
+int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data)
529 529
 {
530 530
     if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {
531 531
         *data = s->buf_ptr;
... ...
@@ -1923,7 +1923,7 @@ static int mpegts_resync(AVFormatContext *s)
1923 1923
 }
1924 1924
 
1925 1925
 /* return -1 if error or EOF. Return 0 if OK. */
1926
-static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, uint8_t **data)
1926
+static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, const uint8_t **data)
1927 1927
 {
1928 1928
     AVIOContext *pb = s->pb;
1929 1929
     int len;
... ...
@@ -1959,7 +1959,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
1959 1959
 {
1960 1960
     AVFormatContext *s = ts->stream;
1961 1961
     uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
1962
-    uint8_t *data;
1962
+    const uint8_t *data;
1963 1963
     int packet_num, ret = 0;
1964 1964
 
1965 1965
     if (avio_tell(s->pb) != ts->last_pos) {
... ...
@@ -2121,7 +2121,7 @@ static int mpegts_read_header(AVFormatContext *s)
2121 2121
         int64_t pcrs[2], pcr_h;
2122 2122
         int packet_count[2];
2123 2123
         uint8_t packet[TS_PACKET_SIZE];
2124
-        uint8_t *data;
2124
+        const uint8_t *data;
2125 2125
 
2126 2126
         /* only read packets */
2127 2127
 
... ...
@@ -2183,7 +2183,7 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
2183 2183
     int64_t pcr_h, next_pcr_h, pos;
2184 2184
     int pcr_l, next_pcr_l;
2185 2185
     uint8_t pcr_buf[12];
2186
-    uint8_t *data;
2186
+    const uint8_t *data;
2187 2187
 
2188 2188
     if (av_new_packet(pkt, TS_PACKET_SIZE) < 0)
2189 2189
         return AVERROR(ENOMEM);