summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-03 05:19:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-03 05:19:30 +0200
commit99eb31e263a24bc6c5a7a3f455a2bcb04a60e70e (patch)
tree83aab2f083fd3d6923d4e76fe0cc0c41ef7aef35 /libavformat
parent9034001b17077e9da5205c4344eb1b88b9882f03 (diff)
parentf190f676bc93a7e80344f2feeb3b9b44604d4717 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits) Replace custom DEBUG preprocessor trickery by the standard one. vorbis: Remove non-compiling debug statement. vorbis: Remove pointless DEBUG #ifdef around debug output macros. cook: Remove non-compiling debug output. Remove pointless #ifdefs around function declarations in a header. Replace #ifdef + av_log() combinations by av_dlog(). Replace custom debug output functions by av_dlog(). cook: Remove unused debug functions. Remove stray extra arguments from av_dlog() invocations. targa: fix big-endian build v4l2: remove one forgotten use of AVFormatParameters.pix_fmt. vfwcap: add a framerate private option. v4l2: add a framerate private option. libdc1394: add a framerate private option. fbdev: add a framerate private option. bktr: add a framerate private option. oma: check avio_read() return value nutdec: remove unused variable Remove unused variables swscale: allocate larger buffer to handle altivec overreads. ... Conflicts: ffmpeg.c libavcodec/dca.c libavcodec/dirac.c libavcodec/error_resilience.c libavcodec/h264.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pthread.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/shorten.c libavcodec/truemotion2.c libavcodec/utils.c libavdevice/dv1394.c libavdevice/fbdev.c libavdevice/libdc1394.c libavdevice/v4l2.c libavformat/4xm.c libavformat/apetag.c libavformat/asfdec.c libavformat/avidec.c libavformat/mmf.c libavformat/mpeg.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/oggdec.c libavformat/oggparseogm.c libavformat/rl2.c libavformat/rmdec.c libavformat/rpl.c libavformat/rtpdec_latm.c libavformat/sauce.c libavformat/sol.c libswscale/utils.c tests/ref/vsynth1/error tests/ref/vsynth2/error Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/4xm.c4
-rw-r--r--libavformat/ape.c4
-rw-r--r--libavformat/apetag.c6
-rw-r--r--libavformat/asfdec.c19
-rw-r--r--libavformat/gif.c4
-rw-r--r--libavformat/ipmovie.c104
-rw-r--r--libavformat/mmf.c4
-rw-r--r--libavformat/mpeg.c7
-rw-r--r--libavformat/mpegenc.c6
-rw-r--r--libavformat/mpegts.c6
-rw-r--r--libavformat/nutdec.c4
-rw-r--r--libavformat/oggdec.c7
-rw-r--r--libavformat/oggparseogm.c4
-rw-r--r--libavformat/oma.c2
-rw-r--r--libavformat/rl2.c6
-rw-r--r--libavformat/rmdec.c4
-rw-r--r--libavformat/rpl.c4
-rw-r--r--libavformat/rtpdec_latm.c5
-rw-r--r--libavformat/rtsp.c3
-rw-r--r--libavformat/sauce.c4
-rw-r--r--libavformat/sol.c3
21 files changed, 84 insertions, 126 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 42ecbde581..0b79c761a5 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -246,7 +246,7 @@ static int fourxm_read_packet(AVFormatContext *s,
FourxmDemuxContext *fourxm = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int fourcc_tag;
- unsigned int size, out_size av_unused;
+ unsigned int size;
int ret = 0;
unsigned int track_number;
int packet_read = 0;
@@ -295,7 +295,7 @@ static int fourxm_read_packet(AVFormatContext *s,
case snd__TAG:
track_number = avio_rl32(pb);
- out_size= avio_rl32(pb);
+ avio_skip(pb, 4);
size-=8;
if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) {
diff --git a/libavformat/ape.c b/libavformat/ape.c
index f6d644f73d..bda6b32b1d 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -26,8 +26,6 @@
#include "avformat.h"
#include "apetag.h"
-#define ENABLE_DEBUG 0
-
/* The earliest and latest file formats supported by this library */
#define APE_MIN_VERSION 3950
#define APE_MAX_VERSION 3990
@@ -96,7 +94,7 @@ static int ape_probe(AVProbeData * p)
static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)
{
-#if ENABLE_DEBUG
+#ifdef DEBUG
int i;
av_log(s, AV_LOG_DEBUG, "Descriptor Block:\n\n");
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 4a464de1f5..42898de93c 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -24,8 +24,6 @@
#include "avformat.h"
#include "apetag.h"
-#define ENABLE_DEBUG 0
-
#define APE_TAG_VERSION 2000
#define APE_TAG_FOOTER_BYTES 32
#define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31)
@@ -35,11 +33,11 @@ static int ape_tag_read_field(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
uint8_t key[1024], *value;
- uint32_t size, flags av_unused;
+ uint32_t size;
int i, c;
size = avio_rl32(pb); /* field size */
- flags = avio_rl32(pb); /* field flags */
+ avio_skip(pb, 4); /* field flags */
for (i = 0; i < sizeof(key) - 1; i++) {
c = avio_r8(pb);
if (c < 0x20 || c > 0x7E)
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e2efeef3ea..c7d961d4b8 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -209,7 +209,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
ff_asf_guid g;
enum AVMediaType type;
int type_specific_size, sizeX;
- uint64_t total_size av_unused;
unsigned int tag1;
int64_t pos1, pos2, start_time;
int test_for_ext_stream_audio, is_dvr_ms_audio=0;
@@ -256,7 +255,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
return -1;
}
ff_get_guid(pb, &g);
- total_size = avio_rl64(pb);
+ avio_skip(pb, 8); /* total_size */
type_specific_size = avio_rl32(pb);
avio_rl32(pb);
st->id = avio_rl16(pb) & 0x7f; /* stream id */
@@ -393,7 +392,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
AVIOContext *pb = s->pb;
ff_asf_guid g;
int ext_len, payload_ext_ct, stream_ct, i;
- uint32_t ext_d av_unused, leak_rate, stream_num;
+ uint32_t leak_rate, stream_num;
unsigned int stream_languageid_index;
avio_rl64(pb); // starttime
@@ -427,7 +426,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
for (i=0; i<payload_ext_ct; i++){
ff_get_guid(pb, &g);
- ext_d=avio_rl16(pb);
+ avio_skip(pb, 2);
ext_len=avio_rl32(pb);
avio_skip(pb, ext_len);
}
@@ -511,7 +510,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
{
AVIOContext *pb = s->pb;
ASFContext *asf = s->priv_data;
- int n, stream_num, name_len, value_len, value_type av_unused, value_num;
+ int n, stream_num, name_len, value_len, value_num;
int ret, i;
n = avio_rl16(pb);
@@ -521,7 +520,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
avio_rl16(pb); //lang_list_index
stream_num= avio_rl16(pb);
name_len= avio_rl16(pb);
- value_type= avio_rl16(pb);
+ avio_skip(pb, 2); /* value_type */
value_len= avio_rl32(pb);
if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
@@ -626,10 +625,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
// if so the next iteration will pick it up
continue;
} else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) {
- av_unused int v1, v2;
ff_get_guid(pb, &g);
- v1 = avio_rl32(pb);
- v2 = avio_rl16(pb);
+ avio_skip(pb, 6);
continue;
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
asf_read_marker(s, gsize);
@@ -799,7 +796,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
ASFContext *asf = s->priv_data;
int rsize = 1;
int num = avio_r8(pb);
- int64_t ts0, ts1 av_unused;
+ int64_t ts0;
asf->packet_segments--;
asf->packet_key_frame = num >> 7;
@@ -822,7 +819,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
// av_log(s, AV_LOG_DEBUG, "\n");
avio_skip(pb, 10);
ts0= avio_rl64(pb);
- ts1= avio_rl64(pb);
+ avio_skip(pb, 8);;
avio_skip(pb, 12);
avio_rl32(pb);
avio_skip(pb, asf->packet_replic_size - 8 - 38 - 4);
diff --git a/libavformat/gif.c b/libavformat/gif.c
index f5f8147e4f..0960705cf3 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -295,9 +295,7 @@ static int gif_write_video(AVFormatContext *s,
AVCodecContext *enc, const uint8_t *buf, int size)
{
AVIOContext *pb = s->pb;
- GIFContext *gif = s->priv_data;
int jiffies;
- int64_t delay;
/* graphic control extension block */
avio_w8(pb, 0x21);
@@ -307,8 +305,6 @@ static int gif_write_video(AVFormatContext *s,
/* 1 jiffy is 1/70 s */
/* the delay_time field indicates the number of jiffies - 1 */
- delay = gif->file_time - gif->time;
-
/* XXX: should use delay, in order to be more accurate */
/* instead of using the same rounded value each time */
/* XXX: don't even remember if I really use it for now */
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 921242f8f8..b6da2911e9 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -35,17 +35,6 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
-/* debugging support: #define DEBUG_IPMOVIE as non-zero to see extremely
- * verbose information about the demux process */
-#define DEBUG_IPMOVIE 0
-
-#if DEBUG_IPMOVIE
-#undef printf
-#define debug_ipmovie printf
-#else
-static inline void debug_ipmovie(const char *format, ...) { }
-#endif
-
#define CHUNK_PREAMBLE_SIZE 4
#define OPCODE_PREAMBLE_SIZE 4
@@ -150,8 +139,8 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
s->audio_frame_count +=
(s->audio_chunk_size - 6) / s->audio_channels;
- debug_ipmovie("sending audio frame with pts %"PRId64" (%d audio frames)\n",
- pkt->pts, s->audio_frame_count);
+ av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
+ pkt->pts, s->audio_frame_count);
chunk_type = CHUNK_VIDEO;
@@ -195,8 +184,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
pkt->stream_index = s->video_stream_index;
pkt->pts = s->video_pts;
- debug_ipmovie("sending video frame with pts %"PRId64"\n",
- pkt->pts);
+ av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
s->video_pts += s->frame_pts_inc;
@@ -244,36 +232,36 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
chunk_size = AV_RL16(&chunk_preamble[0]);
chunk_type = AV_RL16(&chunk_preamble[2]);
- debug_ipmovie("chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
+ av_dlog(NULL, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
switch (chunk_type) {
case CHUNK_INIT_AUDIO:
- debug_ipmovie("initialize audio\n");
+ av_dlog(NULL, "initialize audio\n");
break;
case CHUNK_AUDIO_ONLY:
- debug_ipmovie("audio only\n");
+ av_dlog(NULL, "audio only\n");
break;
case CHUNK_INIT_VIDEO:
- debug_ipmovie("initialize video\n");
+ av_dlog(NULL, "initialize video\n");
break;
case CHUNK_VIDEO:
- debug_ipmovie("video (and audio)\n");
+ av_dlog(NULL, "video (and audio)\n");
break;
case CHUNK_SHUTDOWN:
- debug_ipmovie("shutdown\n");
+ av_dlog(NULL, "shutdown\n");
break;
case CHUNK_END:
- debug_ipmovie("end\n");
+ av_dlog(NULL, "end\n");
break;
default:
- debug_ipmovie("invalid chunk\n");
+ av_dlog(NULL, "invalid chunk\n");
chunk_type = CHUNK_BAD;
break;
@@ -299,29 +287,29 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
chunk_size -= OPCODE_PREAMBLE_SIZE;
chunk_size -= opcode_size;
if (chunk_size < 0) {
- debug_ipmovie("chunk_size countdown just went negative\n");
+ av_dlog(NULL, "chunk_size countdown just went negative\n");
chunk_type = CHUNK_BAD;
break;
}
- debug_ipmovie(" opcode type %02X, version %d, 0x%04X bytes: ",
- opcode_type, opcode_version, opcode_size);
+ av_dlog(NULL, " opcode type %02X, version %d, 0x%04X bytes: ",
+ opcode_type, opcode_version, opcode_size);
switch (opcode_type) {
case OPCODE_END_OF_STREAM:
- debug_ipmovie("end of stream\n");
+ av_dlog(NULL, "end of stream\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_END_OF_CHUNK:
- debug_ipmovie("end of chunk\n");
+ av_dlog(NULL, "end of chunk\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_CREATE_TIMER:
- debug_ipmovie("create timer\n");
+ av_dlog(NULL, "create timer\n");
if ((opcode_version > 0) || (opcode_size > 6)) {
- debug_ipmovie("bad create_timer opcode\n");
+ av_dlog(NULL, "bad create_timer opcode\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -331,14 +319,15 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
break;
}
s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
- debug_ipmovie(" %.2f frames/second (timer div = %d, subdiv = %d)\n",
- 1000000.0/s->frame_pts_inc, AV_RL32(&scratch[0]), AV_RL16(&scratch[4]));
+ av_dlog(NULL, " %.2f frames/second (timer div = %d, subdiv = %d)\n",
+ 1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
+ AV_RL16(&scratch[4]));
break;
case OPCODE_INIT_AUDIO_BUFFERS:
- debug_ipmovie("initialize audio buffers\n");
+ av_dlog(NULL, "initialize audio buffers\n");
if ((opcode_version > 1) || (opcode_size > 10)) {
- debug_ipmovie("bad init_audio_buffers opcode\n");
+ av_dlog(NULL, "bad init_audio_buffers opcode\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -360,23 +349,22 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
s->audio_type = CODEC_ID_PCM_S16LE;
else
s->audio_type = CODEC_ID_PCM_U8;
- debug_ipmovie("audio: %d bits, %d Hz, %s, %s format\n",
- s->audio_bits,
- s->audio_sample_rate,
- (s->audio_channels == 2) ? "stereo" : "mono",
- (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
- "Interplay audio" : "PCM");
+ av_dlog(NULL, "audio: %d bits, %d Hz, %s, %s format\n",
+ s->audio_bits, s->audio_sample_rate,
+ (s->audio_channels == 2) ? "stereo" : "mono",
+ (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
+ "Interplay audio" : "PCM");
break;
case OPCODE_START_STOP_AUDIO:
- debug_ipmovie("start/stop audio\n");
+ av_dlog(NULL, "start/stop audio\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_INIT_VIDEO_BUFFERS:
- debug_ipmovie("initialize video buffers\n");
+ av_dlog(NULL, "initialize video buffers\n");
if ((opcode_version > 2) || (opcode_size > 8)) {
- debug_ipmovie("bad init_video_buffers opcode\n");
+ av_dlog(NULL, "bad init_video_buffers opcode\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -392,8 +380,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
} else {
s->video_bpp = 16;
}
- debug_ipmovie("video resolution: %d x %d\n",
- s->video_width, s->video_height);
+ av_dlog(NULL, "video resolution: %d x %d\n",
+ s->video_width, s->video_height);
break;
case OPCODE_UNKNOWN_06:
@@ -403,17 +391,17 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
case OPCODE_UNKNOWN_13:
case OPCODE_UNKNOWN_14:
case OPCODE_UNKNOWN_15:
- debug_ipmovie("unknown (but documented) opcode %02X\n", opcode_type);
+ av_dlog(NULL, "unknown (but documented) opcode %02X\n", opcode_type);
avio_skip(pb, opcode_size);
break;
case OPCODE_SEND_BUFFER:
- debug_ipmovie("send buffer\n");
+ av_dlog(NULL, "send buffer\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_AUDIO_FRAME:
- debug_ipmovie("audio frame\n");
+ av_dlog(NULL, "audio frame\n");
/* log position and move on for now */
s->audio_chunk_offset = avio_tell(pb);
@@ -422,26 +410,26 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
break;
case OPCODE_SILENCE_FRAME:
- debug_ipmovie("silence frame\n");
+ av_dlog(NULL, "silence frame\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_INIT_VIDEO_MODE:
- debug_ipmovie("initialize video mode\n");
+ av_dlog(NULL, "initialize video mode\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_CREATE_GRADIENT:
- debug_ipmovie("create gradient\n");
+ av_dlog(NULL, "create gradient\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_SET_PALETTE:
- debug_ipmovie("set palette\n");
+ av_dlog(NULL, "set palette\n");
/* check for the logical maximum palette size
* (3 * 256 + 4 bytes) */
if (opcode_size > 0x304) {
- debug_ipmovie("demux_ipmovie: set_palette opcode too large\n");
+ av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -455,7 +443,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
last_color = first_color + AV_RL16(&scratch[2]) - 1;
/* sanity check (since they are 16 bit values) */
if ((first_color > 0xFF) || (last_color > 0xFF)) {
- debug_ipmovie("demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
+ av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
first_color, last_color);
chunk_type = CHUNK_BAD;
break;
@@ -473,12 +461,12 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
break;
case OPCODE_SET_PALETTE_COMPRESSED:
- debug_ipmovie("set palette compressed\n");
+ av_dlog(NULL, "set palette compressed\n");
avio_skip(pb, opcode_size);
break;
case OPCODE_SET_DECODING_MAP:
- debug_ipmovie("set decoding map\n");
+ av_dlog(NULL, "set decoding map\n");
/* log position and move on for now */
s->decode_map_chunk_offset = avio_tell(pb);
@@ -487,7 +475,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
break;
case OPCODE_VIDEO_DATA:
- debug_ipmovie("set video data\n");
+ av_dlog(NULL, "set video data\n");
/* log position and move on for now */
s->video_chunk_offset = avio_tell(pb);
@@ -496,7 +484,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
break;
default:
- debug_ipmovie("*** unknown opcode type\n");
+ av_dlog(NULL, "*** unknown opcode type\n");
chunk_type = CHUNK_BAD;
break;
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index b75bee3a6b..89e33b4ce2 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -186,13 +186,13 @@ static int mmf_read_header(AVFormatContext *s,
unsigned int tag;
AVIOContext *pb = s->pb;
AVStream *st;
- int64_t file_size av_unused, size;
+ int64_t size;
int rate, params;
tag = avio_rl32(pb);
if (tag != MKTAG('M', 'M', 'M', 'D'))
return -1;
- file_size = avio_rb32(pb);
+ avio_skip(pb, 4); /* file_size */
/* Skip some unused chunks that may or may not be present */
for(;; avio_skip(pb, size)) {
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index f9f818951f..7757728150 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -572,10 +572,9 @@ static int mpegps_read_packet(AVFormatContext *s,
pkt->dts = dts;
pkt->pos = dummy_pos;
pkt->stream_index = st->index;
-#if 0
- av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
- pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
-#endif
+ av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+ pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
+ pkt->size);
return 0;
}
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index e42fac4ceb..01b9434187 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1078,10 +1078,8 @@ retry:
best_dts= pkt_desc->dts;
}
-#if 0
- av_log(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
- scr/90000.0, best_dts/90000.0);
-#endif
+ av_dlog(ctx, "bumping scr, scr:%f, dts:%f\n",
+ scr / 90000.0, best_dts / 90000.0);
if(best_dts == INT64_MAX)
return 0;
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index df7a89979d..66b6062a77 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1578,10 +1578,8 @@ static int mpegts_read_header(AVFormatContext *s,
s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
st->codec->bit_rate = s->bit_rate;
st->start_time = ts->cur_pcr;
-#if 0
- av_log(ts->stream, AV_LOG_DEBUG, "start=%0.3f pcr=%0.3f incr=%d\n",
- st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
-#endif
+ av_dlog(ts->stream, "start=%0.3f pcr=%0.3f incr=%d\n",
+ st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
}
avio_seek(pb, pos, SEEK_SET);
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index dd1b8c7e17..0856380649 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -190,7 +190,6 @@ static int decode_main_header(NUTContext *nut){
uint64_t tmp, end;
unsigned int stream_count;
int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx;
- int64_t tmp_match;
end= get_packetheader(nut, bc, 1, MAIN_STARTCODE);
end += avio_tell(bc);
@@ -218,7 +217,6 @@ static int decode_main_header(NUTContext *nut){
tmp_pts=0;
tmp_mul=1;
tmp_stream=0;
- tmp_match= 1-(1LL<<62);
tmp_head_idx= 0;
for(i=0; i<256;){
int tmp_flags = ffio_read_varlen(bc);
@@ -232,7 +230,7 @@ static int decode_main_header(NUTContext *nut){
else tmp_res = 0;
if(tmp_fields>5) count = ffio_read_varlen(bc);
else count = tmp_mul - tmp_size;
- if(tmp_fields>6) tmp_match = get_s(bc);
+ if(tmp_fields>6) get_s(bc);
if(tmp_fields>7) tmp_head_idx= ffio_read_varlen(bc);
while(tmp_fields-- > 8)
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 968cdd90e3..e335358601 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -197,8 +197,6 @@ static int ogg_read_page(AVFormatContext *s, int *str)
int flags, nsegs;
uint64_t gp;
uint32_t serial;
- uint32_t seq av_unused;
- uint32_t crc av_unused;
int size, idx;
uint8_t sync[4];
int sp = 0;
@@ -232,8 +230,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
flags = avio_r8(bc);
gp = avio_rl64 (bc);
serial = avio_rl32 (bc);
- seq = avio_rl32 (bc);
- crc = avio_rl32 (bc);
+ avio_skip(bc, 8); /* seq, crc */
nsegs = avio_r8(bc);
idx = ogg_find_stream (ogg, serial);
@@ -364,8 +361,6 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
}
}while (!complete);
- av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n",
- idx, os->psize, os->pstart);
if (os->granule == -1)
av_log(s, AV_LOG_WARNING, "Page at %"PRId64" is missing granule\n", os->page_pos);
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index ec575e068d..9526c3acc1 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -39,7 +39,6 @@ ogm_header(AVFormatContext *s, int idx)
const uint8_t *p = os->buf + os->pstart;
uint64_t time_unit;
uint64_t spu;
- uint32_t default_len av_unused;
if(!(*p & 1))
return 0;
@@ -74,8 +73,7 @@ ogm_header(AVFormatContext *s, int idx)
time_unit = bytestream_get_le64(&p);
spu = bytestream_get_le64(&p);
- default_len = bytestream_get_le32(&p);
-
+ p += 4; /* default_len */
p += 8; /* buffersize + bits_per_sample */
if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
diff --git a/libavformat/oma.c b/libavformat/oma.c
index f29b16a4d6..aac96d14e5 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -80,6 +80,8 @@ static int oma_read_header(AVFormatContext *s,
ff_id3v2_read(s, ID3v2_EA3_MAGIC);
ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
+ if (ret < EA3_HEADER_SIZE)
+ return -1;
if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
diff --git a/libavformat/rl2.c b/libavformat/rl2.c
index 219aa697b6..e41406791e 100644
--- a/libavformat/rl2.c
+++ b/libavformat/rl2.c
@@ -80,8 +80,6 @@ static av_cold int rl2_read_header(AVFormatContext *s,
unsigned int audio_frame_counter = 0;
unsigned int video_frame_counter = 0;
unsigned int back_size;
- int data_size av_unused;
- unsigned short encoding_method av_unused;
unsigned short sound_rate;
unsigned short rate;
unsigned short channels;
@@ -98,14 +96,14 @@ static av_cold int rl2_read_header(AVFormatContext *s,
avio_skip(pb,4); /* skip FORM tag */
back_size = avio_rl32(pb); /**< get size of the background frame */
signature = avio_rb32(pb);
- data_size = avio_rb32(pb);
+ avio_skip(pb, 4); /* data size */
frame_count = avio_rl32(pb);
/* disallow back_sizes and frame_counts that may lead to overflows later */
if(back_size > INT_MAX/2 || frame_count > INT_MAX / sizeof(uint32_t))
return AVERROR_INVALIDDATA;
- encoding_method = avio_rl16(pb);
+ avio_skip(pb, 2); /* encoding mentod */
sound_rate = avio_rl16(pb);
rate = avio_rl16(pb);
channels = avio_rl16(pb);
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 5c24d021e0..227df6f957 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -280,7 +280,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
if (rm_read_audio_stream_info(s, pb, st, rst, 0))
return -1;
} else {
- int fps, fps2 av_unused;
+ int fps;
if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
fail1:
av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n");
@@ -298,7 +298,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
fps= avio_rb16(pb);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avio_rb32(pb);
- fps2= avio_rb16(pb);
+ avio_skip(pb, 2);
avio_rb16(pb);
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index be5bf9c788..1cb113f81f 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -299,9 +299,9 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
stream->codec->codec_tag == 124) {
// We have to split Escape 124 frames because there are
// multiple frames per chunk in Escape 124 samples.
- uint32_t frame_size, frame_flags av_unused;
+ uint32_t frame_size;
- frame_flags = avio_rl32(pb);
+ avio_skip(pb, 4); /* flags */
frame_size = avio_rl32(pb);
if (avio_seek(pb, -8, SEEK_CUR) < 0)
return AVERROR(EIO);
diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c
index 74754dfd60..4bf2c3fb23 100644
--- a/libavformat/rtpdec_latm.c
+++ b/libavformat/rtpdec_latm.c
@@ -108,8 +108,7 @@ static int parse_fmtp_config(AVStream *st, char *value)
int len = ff_hex_to_data(NULL, value), i, ret = 0;
GetBitContext gb;
uint8_t *config;
- int audio_mux_version, same_time_framing, num_sub_frames av_unused,
- num_programs, num_layers;
+ int audio_mux_version, same_time_framing, num_programs, num_layers;
/* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -119,7 +118,7 @@ static int parse_fmtp_config(AVStream *st, char *value)
init_get_bits(&gb, config, len*8);
audio_mux_version = get_bits(&gb, 1);
same_time_framing = get_bits(&gb, 1);
- num_sub_frames = get_bits(&gb, 6);
+ skip_bits(&gb, 6); /* num_sub_frames */
num_programs = get_bits(&gb, 4);
num_layers = get_bits(&gb, 3);
if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 ||
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 3fdf494ad8..3efa0569ba 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -45,7 +45,6 @@
#include "url.h"
//#define DEBUG
-//#define DEBUG_RTP_TCP
/* Timeout values for socket poll, in ms,
* and read_packet(), in seconds */
@@ -860,9 +859,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
q = buf;
for (;;) {
ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
-#ifdef DEBUG_RTP_TCP
av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
-#endif
if (ret != 1)
return AVERROR_EOF;
if (ch == '\n')
diff --git a/libavformat/sauce.c b/libavformat/sauce.c
index 0b22a75bb9..b2aa1b7b77 100644
--- a/libavformat/sauce.c
+++ b/libavformat/sauce.c
@@ -32,7 +32,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
{
AVIOContext *pb = avctx->pb;
char buf[36];
- int datatype, filetype, t1, t2, nb_comments, flags av_unused;
+ int datatype, filetype, t1, t2, nb_comments;
uint64_t start_pos = avio_size(pb) - 128;
avio_seek(pb, start_pos, SEEK_SET);
@@ -57,7 +57,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g
t1 = avio_rl16(pb);
t2 = avio_rl16(pb);
nb_comments = avio_r8(pb);
- flags = avio_r8(pb);
+ avio_skip(pb, 1); /* flags */
avio_skip(pb, 4);
GET_SAUCE_META("encoder", 22);
diff --git a/libavformat/sol.c b/libavformat/sol.c
index 70fddae92a..c0d2c5d5a2 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -85,7 +85,6 @@ static int sol_channels(int magic, int type)
static int sol_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
- int size av_unused;
unsigned int magic,tag;
AVIOContext *pb = s->pb;
unsigned int id, channels, rate, type;
@@ -99,7 +98,7 @@ static int sol_read_header(AVFormatContext *s,
return -1;
rate = avio_rl16(pb);
type = avio_r8(pb);
- size = avio_rl32(pb);
+ avio_skip(pb, 4); /* size */
if (magic != 0x0B8D)
avio_r8(pb); /* newer SOLs contain padding byte */