summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aacdec.c2
-rw-r--r--libavformat/adtsenc.c2
-rw-r--r--libavformat/apetag.c21
-rw-r--r--libavformat/apetag.h4
-rw-r--r--libavformat/asfdec.c2
-rw-r--r--libavformat/asfenc.c4
-rw-r--r--libavformat/assdec.c2
-rw-r--r--libavformat/assenc.c2
-rw-r--r--libavformat/au.c4
-rw-r--r--libavformat/avidec.c2
-rw-r--r--libavformat/avienc.c2
-rw-r--r--libavformat/cafdec.c2
-rw-r--r--libavformat/cavsvideodec.c2
-rw-r--r--libavformat/dv.c2
-rw-r--r--libavformat/dvenc.c2
-rw-r--r--libavformat/flvdec.c2
-rw-r--r--libavformat/flvenc.c2
-rw-r--r--libavformat/gxf.c2
-rw-r--r--libavformat/gxfenc.c2
-rw-r--r--libavformat/iff.c2
-rw-r--r--libavformat/iv8.c2
-rw-r--r--libavformat/mov.c2
-rw-r--r--libavformat/movenc.c12
-rw-r--r--libavformat/mp3dec.c2
-rw-r--r--libavformat/mp3enc.c4
-rw-r--r--libavformat/mpc.c16
-rw-r--r--libavformat/mpc8.c15
-rw-r--r--libavformat/mpeg.c2
-rw-r--r--libavformat/mpegenc.c6
-rw-r--r--libavformat/mpegts.c4
-rw-r--r--libavformat/mpegtsenc.c2
-rw-r--r--libavformat/mxfdec.c2
-rw-r--r--libavformat/mxfenc.c4
-rw-r--r--libavformat/rawenc.c2
-rw-r--r--libavformat/rtmpproto.c3
-rw-r--r--libavformat/segment.c2
-rw-r--r--libavformat/swfdec.c2
-rw-r--r--libavformat/swfenc.c4
-rw-r--r--libavformat/tta.c2
-rw-r--r--libavformat/wav.c4
-rw-r--r--libavformat/wv.c9
41 files changed, 96 insertions, 70 deletions
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index 966f61b..3289b0d 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -84,7 +84,7 @@ static int adts_aac_read_header(AVFormatContext *s)
AVInputFormat ff_aac_demuxer = {
.name = "aac",
- .long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
+ .long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
.read_probe = adts_aac_probe,
.read_header = adts_aac_read_header,
.read_packet = ff_raw_read_partial_packet,
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index bc2397f..396cf8b 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -165,7 +165,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_adts_muxer = {
.name = "adts",
- .long_name = NULL_IF_CONFIG_SMALL("ADTS AAC"),
+ .long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
.mime_type = "audio/aac",
.extensions = "aac,adts",
.priv_data_size = sizeof(ADTSContext),
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 6f6a61b..1818892 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -111,40 +111,47 @@ static int ape_tag_read_field(AVFormatContext *s)
return 0;
}
-void ff_ape_parse_tag(AVFormatContext *s)
+int64_t ff_ape_parse_tag(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int file_size = avio_size(pb);
uint32_t val, fields, tag_bytes;
uint8_t buf[8];
+ int64_t tag_start;
int i;
if (file_size < APE_TAG_FOOTER_BYTES)
- return;
+ return 0;
avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
avio_read(pb, buf, 8); /* APETAGEX */
if (strncmp(buf, APE_TAG_PREAMBLE, 8)) {
- return;
+ return 0;
}
val = avio_rl32(pb); /* APE tag version */
if (val > APE_TAG_VERSION) {
av_log(s, AV_LOG_ERROR, "Unsupported tag version. (>=%d)\n", APE_TAG_VERSION);
- return;
+ return 0;
}
tag_bytes = avio_rl32(pb); /* tag size */
if (tag_bytes - APE_TAG_FOOTER_BYTES > (1024 * 1024 * 16)) {
av_log(s, AV_LOG_ERROR, "Tag size is way too big\n");
- return;
+ return 0;
+ }
+
+ tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES;
+ if (tag_start < 0) {
+ av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes);
+ return 0;
}
fields = avio_rl32(pb); /* number of fields */
if (fields > 65536) {
av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields);
- return;
+ return 0;
}
val = avio_rl32(pb); /* flags */
@@ -157,4 +164,6 @@ void ff_ape_parse_tag(AVFormatContext *s)
for (i=0; i<fields; i++)
if (ape_tag_read_field(s) < 0) break;
+
+ return tag_start;
}
diff --git a/libavformat/apetag.h b/libavformat/apetag.h
index 17a9a72..0330c89 100644
--- a/libavformat/apetag.h
+++ b/libavformat/apetag.h
@@ -31,8 +31,10 @@
/**
* Read and parse an APE tag
+ *
+ * @return offset of the tag start in the file
*/
-void ff_ape_parse_tag(AVFormatContext *s);
+int64_t ff_ape_parse_tag(AVFormatContext *s);
/**
* Write an APEv2 tag
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 9bd55cc..25c7ae5 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1410,7 +1410,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
AVInputFormat ff_asf_demuxer = {
.name = "asf",
- .long_name = NULL_IF_CONFIG_SMALL("ASF format"),
+ .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.priv_data_size = sizeof(ASFContext),
.read_probe = asf_probe,
.read_header = asf_read_header,
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 92ac818..5b5b0b0 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -901,7 +901,7 @@ static int asf_write_trailer(AVFormatContext *s)
#if CONFIG_ASF_MUXER
AVOutputFormat ff_asf_muxer = {
.name = "asf",
- .long_name = NULL_IF_CONFIG_SMALL("ASF format"),
+ .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
@@ -920,7 +920,7 @@ AVOutputFormat ff_asf_muxer = {
#if CONFIG_ASF_STREAM_MUXER
AVOutputFormat ff_asf_stream_muxer = {
.name = "asf_stream",
- .long_name = NULL_IF_CONFIG_SMALL("ASF format"),
+ .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 157d228..6295888 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -205,7 +205,7 @@ static int read_seek2(AVFormatContext *s, int stream_index,
AVInputFormat ff_ass_demuxer = {
.name = "ass",
- .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
+ .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.priv_data_size = sizeof(ASSContext),
.read_probe = probe,
.read_header = read_header,
diff --git a/libavformat/assenc.c b/libavformat/assenc.c
index 515ee04..73f6613 100644
--- a/libavformat/assenc.c
+++ b/libavformat/assenc.c
@@ -79,7 +79,7 @@ static int write_trailer(AVFormatContext *s)
AVOutputFormat ff_ass_muxer = {
.name = "ass",
- .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
+ .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.mime_type = "text/x-ssa",
.extensions = "ass,ssa",
.priv_data_size = sizeof(ASSContext),
diff --git a/libavformat/au.c b/libavformat/au.c
index b78d1ac..69d93c6 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -195,7 +195,7 @@ static int au_read_packet(AVFormatContext *s,
#if CONFIG_AU_DEMUXER
AVInputFormat ff_au_demuxer = {
.name = "au",
- .long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
+ .long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
.read_probe = au_probe,
.read_header = au_read_header,
.read_packet = au_read_packet,
@@ -207,7 +207,7 @@ AVInputFormat ff_au_demuxer = {
#if CONFIG_AU_MUXER
AVOutputFormat ff_au_muxer = {
.name = "au",
- .long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
+ .long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
.mime_type = "audio/basic",
.extensions = "au",
.audio_codec = CODEC_ID_PCM_S16BE,
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 99a95b2..b62cccd 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1562,7 +1562,7 @@ static int avi_probe(AVProbeData *p)
AVInputFormat ff_avi_demuxer = {
.name = "avi",
- .long_name = NULL_IF_CONFIG_SMALL("AVI format"),
+ .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.priv_data_size = sizeof(AVIContext),
.read_probe = avi_probe,
.read_header = avi_read_header,
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 4c983b5..0a68aa7 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -650,7 +650,7 @@ static int avi_write_trailer(AVFormatContext *s)
AVOutputFormat ff_avi_muxer = {
.name = "avi",
- .long_name = NULL_IF_CONFIG_SMALL("AVI format"),
+ .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.mime_type = "video/x-msvideo",
.extensions = "avi",
.priv_data_size = sizeof(AVIContext),
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 15b3a8f..2c967f0 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -417,7 +417,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
AVInputFormat ff_caf_demuxer = {
.name = "caf",
- .long_name = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
+ .long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
.priv_data_size = sizeof(CaffContext),
.read_probe = probe,
.read_header = read_header,
diff --git a/libavformat/cavsvideodec.c b/libavformat/cavsvideodec.c
index 4a399a2..a554380 100644
--- a/libavformat/cavsvideodec.c
+++ b/libavformat/cavsvideodec.c
@@ -65,4 +65,4 @@ static int cavsvideo_probe(AVProbeData *p)
return 0;
}
-FF_DEF_RAWVIDEO_DEMUXER(cavsvideo, "raw Chinese AVS video", cavsvideo_probe, NULL, CODEC_ID_CAVS)
+FF_DEF_RAWVIDEO_DEMUXER(cavsvideo, "raw Chinese AVS (Audio Video Standard)", cavsvideo_probe, NULL, CODEC_ID_CAVS)
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 2faeb95..7ea2d53 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -591,7 +591,7 @@ static int dv_probe(AVProbeData *p)
#if CONFIG_DV_DEMUXER
AVInputFormat ff_dv_demuxer = {
.name = "dv",
- .long_name = NULL_IF_CONFIG_SMALL("DV video"),
+ .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
.priv_data_size = sizeof(RawDVContext),
.read_probe = dv_probe,
.read_header = dv_read_header,
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index b936c69..880caea 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -407,7 +407,7 @@ static int dv_write_trailer(struct AVFormatContext *s)
AVOutputFormat ff_dv_muxer = {
.name = "dv",
- .long_name = NULL_IF_CONFIG_SMALL("DV video"),
+ .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
.extensions = "dv",
.priv_data_size = sizeof(DVMuxContext),
.audio_codec = CODEC_ID_PCM_S16LE,
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index f8c25d3..5b81f39 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -889,7 +889,7 @@ static const AVClass class = {
AVInputFormat ff_flv_demuxer = {
.name = "flv",
- .long_name = NULL_IF_CONFIG_SMALL("FLV format"),
+ .long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
.priv_data_size = sizeof(FLVContext),
.read_probe = flv_probe,
.read_header = flv_read_header,
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index c6a676a..a4911b8 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -566,7 +566,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_flv_muxer = {
.name = "flv",
- .long_name = NULL_IF_CONFIG_SMALL("FLV format"),
+ .long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
.mime_type = "video/x-flv",
.extensions = "flv",
.priv_data_size = sizeof(FLVContext),
diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index 5d42ff6..ec82a7b 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -569,7 +569,7 @@ static int64_t gxf_read_timestamp(AVFormatContext *s, int stream_index,
AVInputFormat ff_gxf_demuxer = {
.name = "gxf",
- .long_name = NULL_IF_CONFIG_SMALL("GXF format"),
+ .long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
.priv_data_size = sizeof(struct gxf_stream_info),
.read_probe = gxf_probe,
.read_header = gxf_header,
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 3c5078c..c1a2bb5 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -986,7 +986,7 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pk
AVOutputFormat ff_gxf_muxer = {
.name = "gxf",
- .long_name = NULL_IF_CONFIG_SMALL("GXF format"),
+ .long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
.extensions = "gxf",
.priv_data_size = sizeof(GXFContext),
.audio_codec = CODEC_ID_PCM_S16LE,
diff --git a/libavformat/iff.c b/libavformat/iff.c
index ab87304..546836a 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -388,7 +388,7 @@ static int iff_read_packet(AVFormatContext *s,
AVInputFormat ff_iff_demuxer = {
.name = "iff",
- .long_name = NULL_IF_CONFIG_SMALL("Interchange File Format"),
+ .long_name = NULL_IF_CONFIG_SMALL("IFF (Interchange File Format)"),
.priv_data_size = sizeof(IffDemuxContext),
.read_probe = iff_probe,
.read_header = iff_read_header,
diff --git a/libavformat/iv8.c b/libavformat/iv8.c
index c70a286..6d482b9 100644
--- a/libavformat/iv8.c
+++ b/libavformat/iv8.c
@@ -110,7 +110,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AVInputFormat ff_iv8_demuxer = {
.name = "iv8",
- .long_name = NULL_IF_CONFIG_SMALL("A format generated by IndigoVision 8000 video server"),
+ .long_name = NULL_IF_CONFIG_SMALL("IndigoVision 8000 video"),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 98e88af..46962d7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3193,7 +3193,7 @@ static const AVClass class = {
AVInputFormat ff_mov_demuxer = {
.name = "mov,mp4,m4a,3gp,3g2,mj2",
- .long_name = NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"),
+ .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
.priv_data_size = sizeof(MOVContext),
.read_probe = mov_probe,
.read_header = mov_read_header,
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 48b7e6a..8196b73 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3582,7 +3582,7 @@ static int mov_write_trailer(AVFormatContext *s)
MOV_CLASS(mov)
AVOutputFormat ff_mov_muxer = {
.name = "mov",
- .long_name = NULL_IF_CONFIG_SMALL("MOV format"),
+ .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
.extensions = "mov",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AAC,
@@ -3602,7 +3602,7 @@ AVOutputFormat ff_mov_muxer = {
MOV_CLASS(tgp)
AVOutputFormat ff_tgp_muxer = {
.name = "3gp",
- .long_name = NULL_IF_CONFIG_SMALL("3GP format"),
+ .long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
.extensions = "3gp",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AMR_NB,
@@ -3619,7 +3619,7 @@ AVOutputFormat ff_tgp_muxer = {
MOV_CLASS(mp4)
AVOutputFormat ff_mp4_muxer = {
.name = "mp4",
- .long_name = NULL_IF_CONFIG_SMALL("MP4 format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
.mime_type = "application/mp4",
.extensions = "mp4",
.priv_data_size = sizeof(MOVMuxContext),
@@ -3638,7 +3638,7 @@ AVOutputFormat ff_mp4_muxer = {
MOV_CLASS(psp)
AVOutputFormat ff_psp_muxer = {
.name = "psp",
- .long_name = NULL_IF_CONFIG_SMALL("PSP MP4 format"),
+ .long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
.extensions = "mp4,psp",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AAC,
@@ -3656,7 +3656,7 @@ AVOutputFormat ff_psp_muxer = {
MOV_CLASS(tg2)
AVOutputFormat ff_tg2_muxer = {
.name = "3g2",
- .long_name = NULL_IF_CONFIG_SMALL("3GP2 format"),
+ .long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
.extensions = "3g2",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AMR_NB,
@@ -3673,7 +3673,7 @@ AVOutputFormat ff_tg2_muxer = {
MOV_CLASS(ipod)
AVOutputFormat ff_ipod_muxer = {
.name = "ipod",
- .long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 format"),
+ .long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
.mime_type = "application/mp4",
.extensions = "m4v,m4a",
.priv_data_size = sizeof(MOVMuxContext),
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 3d52c3f..aa936c0 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -234,7 +234,7 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, in
AVInputFormat ff_mp3_demuxer = {
.name = "mp3",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"),
+ .long_name = NULL_IF_CONFIG_SMALL("MP2/3 (MPEG audio layer 2/3)"),
.priv_data_size = sizeof(MP3Context),
.read_probe = mp3_read_probe,
.read_header = mp3_read_header,
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index cc99e77..80d4675 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -373,7 +373,7 @@ static int mp2_write_trailer(struct AVFormatContext *s)
#if CONFIG_MP2_MUXER
AVOutputFormat ff_mp2_muxer = {
.name = "mp2",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
+ .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
.mime_type = "audio/x-mpeg",
.extensions = "mp2,m2a",
.audio_codec = CODEC_ID_MP2,
@@ -507,7 +507,7 @@ static int mp3_write_trailer(AVFormatContext *s)
AVOutputFormat ff_mp3_muxer = {
.name = "mp3",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
+ .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
.mime_type = "audio/x-mpeg",
.extensions = "mp3",
.priv_data_size = sizeof(MP3Context),
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index 4637fcb..03e09e9 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -59,17 +59,17 @@ static int mpc_read_header(AVFormatContext *s)
if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
c->ver = avio_r8(s->pb);
if(c->ver != 0x07 && c->ver != 0x17){
av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
- return -1;
+ return AVERROR_INVALIDDATA;
}
c->fcount = avio_rl32(s->pb);
if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if(c->fcount){
c->frames = av_malloc(c->fcount * sizeof(MPCFrame));
@@ -122,7 +122,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
if (c->curframe >= c->fcount && c->fcount)
- return -1;
+ return AVERROR_EOF;
if(c->curframe != c->lastframe + 1){
avio_seek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
@@ -151,8 +151,8 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
}
c->curbits = (curbits + size2) & 0x1F;
- if (av_new_packet(pkt, size) < 0)
- return AVERROR(EIO);
+ if ((ret = av_new_packet(pkt, size)) < 0)
+ return ret;
pkt->data[0] = curbits;
pkt->data[1] = (c->curframe > c->fcount) && c->fcount;
@@ -166,7 +166,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_seek(s->pb, -4, SEEK_CUR);
if(ret < size){
av_free_packet(pkt);
- return AVERROR(EIO);
+ return ret < 0 ? ret : AVERROR(EIO);
}
pkt->size = ret + 4;
@@ -214,7 +214,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
ret = av_read_frame(s, pkt);
if (ret < 0){
c->curframe = lastframe;
- return -1;
+ return ret;
}
av_free_packet(pkt);
}
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 0261154..2951c27 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -52,6 +52,8 @@ typedef struct {
int frame;
int64_t header_pos;
int64_t samples;
+
+ int64_t apetag_start;
} MPCContext;
static inline int64_t bs_get_v(uint8_t **bs)
@@ -200,7 +202,7 @@ static int mpc8_read_header(AVFormatContext *s)
c->header_pos = avio_tell(pb);
if(avio_rl32(pb) != TAG_MPCK){
av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
while(!url_feof(pb)){
@@ -212,14 +214,14 @@ static int mpc8_read_header(AVFormatContext *s)
}
if(tag != TAG_STREAMHDR){
av_log(s, AV_LOG_ERROR, "Stream header not found\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
pos = avio_tell(pb);
avio_skip(pb, 4); //CRC
c->ver = avio_r8(pb);
if(c->ver != 8){
av_log(s, AV_LOG_ERROR, "Unknown stream version %d\n", c->ver);
- return -1;
+ return AVERROR_PATCHWELCOME;
}
c->samples = ffio_read_varlen(pb);
ffio_read_varlen(pb); //silence samples at the beginning
@@ -245,7 +247,7 @@ static int mpc8_read_header(AVFormatContext *s)
if (pb->seekable) {
int64_t pos = avio_tell(s->pb);
- ff_ape_parse_tag(s);
+ c->apetag_start = ff_ape_parse_tag(s);
avio_seek(s->pb, pos, SEEK_SET);
}
@@ -260,6 +262,11 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
while(!url_feof(s->pb)){
pos = avio_tell(s->pb);
+
+ /* don't return bogus packets with the ape tag data */
+ if (c->apetag_start && pos >= c->apetag_start)
+ return AVERROR_EOF;
+
mpc8_get_chunk_header(s->pb, &tag, &size);
if (size < 0)
return -1;
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 3183f87..e5378ce 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -573,7 +573,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
AVInputFormat ff_mpegps_demuxer = {
.name = "mpeg",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-PS format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-PS (MPEG-2 Program Stream)"),
.priv_data_size = sizeof(MpegDemuxContext),
.read_probe = mpegps_probe,
.read_header = mpegps_read_header,
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index cf92631..c9f1e8e 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1147,7 +1147,7 @@ static const AVClass flavor ## _class = {\
MPEGENC_CLASS(mpeg)
AVOutputFormat ff_mpeg1system_muxer = {
.name = "mpeg",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
.mime_type = "video/mpeg",
.extensions = "mpg,mpeg",
.priv_data_size = sizeof(MpegMuxContext),
@@ -1163,7 +1163,7 @@ AVOutputFormat ff_mpeg1system_muxer = {
MPEGENC_CLASS(vcd)
AVOutputFormat ff_mpeg1vcd_muxer = {
.name = "vcd",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format (VCD)"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
.mime_type = "video/mpeg",
.priv_data_size = sizeof(MpegMuxContext),
.audio_codec = CODEC_ID_MP2,
@@ -1196,7 +1196,7 @@ AVOutputFormat ff_mpeg2vob_muxer = {
MPEGENC_CLASS(svcd)
AVOutputFormat ff_mpeg2svcd_muxer = {
.name = "svcd",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
.mime_type = "video/mpeg",
.extensions = "vob",
.priv_data_size = sizeof(MpegMuxContext),
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 3a5ed69..17329b9 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2217,7 +2217,7 @@ void ff_mpegts_parse_close(MpegTSContext *ts)
AVInputFormat ff_mpegts_demuxer = {
.name = "mpegts",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
.priv_data_size = sizeof(MpegTSContext),
.read_probe = mpegts_probe,
.read_header = mpegts_read_header,
@@ -2229,7 +2229,7 @@ AVInputFormat ff_mpegts_demuxer = {
AVInputFormat ff_mpegtsraw_demuxer = {
.name = "mpegtsraw",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 raw transport stream format"),
+ .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-TS (MPEG-2 Transport Stream)"),
.priv_data_size = sizeof(MpegTSContext),
.read_header = mpegts_read_header,
.read_packet = mpegts_raw_read_packet,
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index aba266b..5d74971 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1225,7 +1225,7 @@ static int mpegts_write_end(AVFormatContext *s)
AVOutputFormat ff_mpegts_muxer = {
.name = "mpegts",
- .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
.mime_type = "video/x-mpegts",
.extensions = "ts,m2t,m2ts,mts",
.priv_data_size = sizeof(MpegTSWrite),
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d4f711a..b544d71 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2241,7 +2241,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
AVInputFormat ff_mxf_demuxer = {
.name = "mxf",
- .long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
.priv_data_size = sizeof(MXFContext),
.read_probe = mxf_probe,
.read_header = mxf_read_header,
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 5fa7ea2..987f270 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2158,7 +2158,7 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
AVOutputFormat ff_mxf_muxer = {
.name = "mxf",
- .long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"),
+ .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
.mime_type = "application/mxf",
.extensions = "mxf",
.priv_data_size = sizeof(MXFContext),
@@ -2173,7 +2173,7 @@ AVOutputFormat ff_mxf_muxer = {
AVOutputFormat ff_mxf_d10_muxer = {
.name = "mxf_d10",
- .long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format, D-10 Mapping"),
+ .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
.mime_type = "application/mxf",
.priv_data_size = sizeof(MXFContext),
.audio_codec = CODEC_ID_PCM_S16LE,
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index d148248..f9b92f5 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -60,7 +60,7 @@ AVOutputFormat ff_adx_muxer = {
#if CONFIG_CAVSVIDEO_MUXER
AVOutputFormat ff_cavsvideo_muxer = {
.name = "cavsvideo",
- .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
+ .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
.extensions = "cavs",
.audio_codec = CODEC_ID_NONE,
.video_codec = CODEC_ID_CAVS,
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f68b7e6..11ffca9 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1114,7 +1114,8 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
break;
case RTMP_PT_VIDEO:
case RTMP_PT_AUDIO:
- /* Audio and Video packets are parsed in get_packet() */
+ case RTMP_PT_METADATA:
+ /* Audio, Video and Metadata packets are parsed in get_packet() */
break;
default:
av_log(s, AV_LOG_VERBOSE, "Unknown packet type received 0x%02X\n", pkt->type);
diff --git a/libavformat/segment.c b/libavformat/segment.c
index f96398b..744c147 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -385,7 +385,7 @@ static const AVClass seg_class = {
AVOutputFormat ff_segment_muxer = {
.name = "segment",
- .long_name = NULL_IF_CONFIG_SMALL("segment muxer"),
+ .long_name = NULL_IF_CONFIG_SMALL("segment"),
.priv_data_size = sizeof(SegmentContext),
.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
.write_header = seg_write_header,
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 10a2ed7..f74f453 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -276,7 +276,7 @@ static av_cold int swf_read_close(AVFormatContext *avctx)
AVInputFormat ff_swf_demuxer = {
.name = "swf",
- .long_name = NULL_IF_CONFIG_SMALL("Flash format"),
+ .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
.priv_data_size = sizeof(SWFContext),
.read_probe = swf_probe,
.read_header = swf_read_header,
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index f56c580..9eb2540 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -505,7 +505,7 @@ static int swf_write_trailer(AVFormatContext *s)
#if CONFIG_SWF_MUXER
AVOutputFormat ff_swf_muxer = {
.name = "swf",
- .long_name = NULL_IF_CONFIG_SMALL("Flash format"),
+ .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
.mime_type = "application/x-shockwave-flash",
.extensions = "swf",
.priv_data_size = sizeof(SWFContext),
@@ -520,7 +520,7 @@ AVOutputFormat ff_swf_muxer = {
#if CONFIG_AVM2_MUXER
AVOutputFormat ff_avm2_muxer = {
.name = "avm2",
- .long_name = NULL_IF_CONFIG_SMALL("Flash 9 (AVM2) format"),
+ .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
.mime_type = "application/x-shockwave-flash",
.priv_data_size = sizeof(SWFContext),
.audio_codec = CODEC_ID_MP3,
diff --git a/libavformat/tta.c b/libavformat/tta.c
index 2de6f5f..dc58dcd 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -160,7 +160,7 @@ static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
AVInputFormat ff_tta_demuxer = {
.name = "tta",
- .long_name = NULL_IF_CONFIG_SMALL("True Audio"),
+ .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.priv_data_size = sizeof(TTAContext),
.read_probe = tta_probe,
.read_header = tta_read_header,
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 749b2c5..caf01a2 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -215,7 +215,7 @@ static const AVClass wav_muxer_class = {
AVOutputFormat ff_wav_muxer = {
.name = "wav",
- .long_name = NULL_IF_CONFIG_SMALL("WAV format"),
+ .long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
.mime_type = "audio/x-wav",
.extensions = "wav",
.priv_data_size = sizeof(WAVContext),
@@ -699,7 +699,7 @@ static const AVClass wav_demuxer_class = {
};
AVInputFormat ff_wav_demuxer = {
.name = "wav",
- .long_name = NULL_IF_CONFIG_SMALL("WAV format"),
+ .long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
.priv_data_size = sizeof(WAVContext),
.read_probe = wav_probe,
.read_header = wav_read_header,
diff --git a/libavformat/wv.c b/libavformat/wv.c
index cc01ff1..95d5044 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -64,6 +64,8 @@ typedef struct {
int block_parsed;
uint8_t extra[WV_EXTRA_SIZE];
int64_t pos;
+
+ int64_t apetag_start;
} WVContext;
static int wv_probe(AVProbeData *p)
@@ -88,6 +90,11 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb,
uint32_t chmask;
wc->pos = avio_tell(pb);
+
+ /* don't return bogus packets with the ape tag data */
+ if (wc->apetag_start && wc->pos >= wc->apetag_start)
+ return AVERROR_EOF;
+
if (!append) {
tag = avio_rl32(pb);
if (tag != MKTAG('w', 'v', 'p', 'k'))
@@ -252,7 +259,7 @@ static int wv_read_header(AVFormatContext *s)
if (s->pb->seekable) {
int64_t cur = avio_tell(s->pb);
- ff_ape_parse_tag(s);
+ wc->apetag_start = ff_ape_parse_tag(s);
if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
ff_id3v1_read(s);
avio_seek(s->pb, cur, SEEK_SET);
OpenPOWER on IntegriCloud