Commit a0fb6083 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '5afe1d27'

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

Conflicts:
	libavformat/mpegts.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents f09b5fb4 5afe1d27
...@@ -52,7 +52,7 @@ int ffio_init_context(AVIOContext *s, ...@@ -52,7 +52,7 @@ int ffio_init_context(AVIOContext *s,
* will be a copy of buf * will be a copy of buf
* @return number of bytes read or AVERROR * @return number of bytes read or AVERROR
*/ */
int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data); int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data);
/** /**
* Read size bytes from AVIOContext into buf. * Read size bytes from AVIOContext into buf.
......
...@@ -525,7 +525,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size) ...@@ -525,7 +525,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
return size1 - size; return size1 - size;
} }
int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data) int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data)
{ {
if (s->buf_end - s->buf_ptr >= size && !s->write_flag) { if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {
*data = s->buf_ptr; *data = s->buf_ptr;
......
...@@ -1923,7 +1923,7 @@ static int mpegts_resync(AVFormatContext *s) ...@@ -1923,7 +1923,7 @@ static int mpegts_resync(AVFormatContext *s)
} }
/* return -1 if error or EOF. Return 0 if OK. */ /* return -1 if error or EOF. Return 0 if OK. */
static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, uint8_t **data) static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, const uint8_t **data)
{ {
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
int len; int len;
...@@ -1959,7 +1959,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets) ...@@ -1959,7 +1959,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
{ {
AVFormatContext *s = ts->stream; AVFormatContext *s = ts->stream;
uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
uint8_t *data; const uint8_t *data;
int packet_num, ret = 0; int packet_num, ret = 0;
if (avio_tell(s->pb) != ts->last_pos) { if (avio_tell(s->pb) != ts->last_pos) {
...@@ -2121,7 +2121,7 @@ static int mpegts_read_header(AVFormatContext *s) ...@@ -2121,7 +2121,7 @@ static int mpegts_read_header(AVFormatContext *s)
int64_t pcrs[2], pcr_h; int64_t pcrs[2], pcr_h;
int packet_count[2]; int packet_count[2];
uint8_t packet[TS_PACKET_SIZE]; uint8_t packet[TS_PACKET_SIZE];
uint8_t *data; const uint8_t *data;
/* only read packets */ /* only read packets */
...@@ -2183,7 +2183,7 @@ static int mpegts_raw_read_packet(AVFormatContext *s, ...@@ -2183,7 +2183,7 @@ static int mpegts_raw_read_packet(AVFormatContext *s,
int64_t pcr_h, next_pcr_h, pos; int64_t pcr_h, next_pcr_h, pos;
int pcr_l, next_pcr_l; int pcr_l, next_pcr_l;
uint8_t pcr_buf[12]; uint8_t pcr_buf[12];
uint8_t *data; const uint8_t *data;
if (av_new_packet(pkt, TS_PACKET_SIZE) < 0) if (av_new_packet(pkt, TS_PACKET_SIZE) < 0)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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