diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-14 01:53:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-14 01:53:31 +0100 |
commit | 04b53746ad296b9167002ec5d16a9cfb9de7985b (patch) | |
tree | 091021a7ecae7fe76b9d180c2fa1a2d4a4c66ef4 /libavformat | |
parent | 387783749faca39c98571d139c32866923ab5653 (diff) | |
parent | 7dfe8f55575a3ae0fdd6f0678fa9627122580b07 (diff) | |
download | ffmpeg-04b53746ad296b9167002ec5d16a9cfb9de7985b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
rtpdec: Use 4 byte startcodes for H.264
matroskadec: Mark variable as av_unused.
Move some conditionally used variables into the block where they are used.
Drop some completely unnecessary av_unused attributes.
swscale: Remove unused variable alpMmxFilter.
Drop unnecessary av_uninit attributes from some variable declarations.
movenc: Support muxing wmapro in ismv/isma
mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written
swscale: move YUV2PACKED16WRAPPER() macro down to where it is used.
swscale: handle gray16 as a "planar" YUV format (Y-only, of course).
swscale: use yuv2packed1() functions for unscaled chroma also.
swscale: fix incorrect chroma bias in yuv2rgb48_1_c().
swscale: fix invalid memory accesses in yuvpacked1() functions.
Move PS2 MMI code below the mips subdirectory, where it belongs.
mips: Move MMI function declarations to a header.
build: Set correct dependencies for rtmp* protocols implemented by librtmp.
Conflicts:
libavcodec/ac3enc_template.c
libavformat/mpegtsenc.c
libswscale/output.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/allformats.c | 10 | ||||
-rw-r--r-- | libavformat/asfdec.c | 2 | ||||
-rw-r--r-- | libavformat/matroskadec.c | 2 | ||||
-rw-r--r-- | libavformat/movenc.c | 19 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 10 | ||||
-rw-r--r-- | libavformat/nsvdec.c | 4 | ||||
-rw-r--r-- | libavformat/rtpdec_h264.c | 4 |
7 files changed, 37 insertions, 14 deletions
diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 134839ffa1..8b1c525217 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -271,12 +271,10 @@ void av_register_all(void) REGISTER_PROTOCOL (MD5, md5); REGISTER_PROTOCOL (PIPE, pipe); REGISTER_PROTOCOL (RTMP, rtmp); -#if CONFIG_LIBRTMP - REGISTER_PROTOCOL (RTMP, rtmpt); - REGISTER_PROTOCOL (RTMP, rtmpe); - REGISTER_PROTOCOL (RTMP, rtmpte); - REGISTER_PROTOCOL (RTMP, rtmps); -#endif + REGISTER_PROTOCOL (RTMPE, rtmpe); + REGISTER_PROTOCOL (RTMPS, rtmps); + REGISTER_PROTOCOL (RTMPT, rtmpt); + REGISTER_PROTOCOL (RTMPTE, rtmpte); REGISTER_PROTOCOL (RTP, rtp); REGISTER_PROTOCOL (TCP, tcp); REGISTER_PROTOCOL (TLS, tls); diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 2c2bd47802..e2f46dc005 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -361,8 +361,8 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) /* This code assumes that extradata contains only palette */ /* This is true for all paletted codecs implemented in libavcodec */ if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) { - int av_unused i; #if HAVE_BIGENDIAN + int i; for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) asf_st->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]); #else diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index bb7a14e072..ddf60e48b2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -967,7 +967,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, uint8_t* data = *buf; int isize = *buf_size; uint8_t* pkt_data = NULL; - uint8_t* newpktdata; + uint8_t av_unused *newpktdata; int pkt_size = isize; int result = 0; int olen; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index dcc0d76e33..fe5a55c66f 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -362,6 +362,15 @@ static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track) return update_size(pb, pos); } +static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); + ffio_wfourcc(pb, "wfex"); + ff_put_wav_header(pb, track->enc); + return update_size(pb, pos); +} + static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track) { uint32_t layout_tag, bitmap; @@ -548,6 +557,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) mov_write_ac3_tag(pb, track); else if(track->enc->codec_id == CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); + else if (track->enc->codec_id == CODEC_ID_WMAPRO) + mov_write_wfex_tag(pb, track); else if (track->vos_len > 0) mov_write_glbl_tag(pb, track); @@ -797,9 +808,13 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag = track->enc->codec_tag; - if (track->mode == MODE_MP4 || track->mode == MODE_PSP || track->mode == MODE_ISM) + if (track->mode == MODE_MP4 || track->mode == MODE_PSP) + tag = mp4_get_codec_tag(s, track); + else if (track->mode == MODE_ISM) { tag = mp4_get_codec_tag(s, track); - else if (track->mode == MODE_IPOD) + if (!tag && track->enc->codec_id == CODEC_ID_WMAPRO) + tag = MKTAG('w', 'm', 'a', ' '); + } else if (track->mode == MODE_IPOD) tag = ipod_get_codec_tag(s, track); else if (track->mode & MODE_3GP) tag = ff_codec_get_tag(codec_3gp_tags, track->enc->codec_id); diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 4b303def4b..b0047a216e 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -78,6 +78,8 @@ typedef struct MpegTSWrite { int pmt_start_pid; int start_pid; int m2ts_mode; + + int reemit_pat_pmt; } MpegTSWrite; /* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */ @@ -101,6 +103,8 @@ static const AVOption options[] = { { "muxrate", NULL, offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, {1}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { "pes_payload_size", "Minimum PES packet payload in bytes", offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, {DEFAULT_PES_PAYLOAD_SIZE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + { "resend_headers", "Reemit PAT/PMT before writing the next packet", + offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { NULL }, }; @@ -978,6 +982,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE)*2; int64_t dts = AV_NOPTS_VALUE, pts = AV_NOPTS_VALUE; + if (ts->reemit_pat_pmt) { + ts->pat_packet_count = ts->pat_packet_period - 1; + ts->sdt_packet_count = ts->sdt_packet_period - 1; + ts->reemit_pat_pmt = 0; + } + if (pkt->pts != AV_NOPTS_VALUE) pts = pkt->pts + delay; if (pkt->dts != AV_NOPTS_VALUE) diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index d581cfb50e..87abce9b21 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -272,7 +272,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; - unsigned int av_unused file_size; + unsigned int file_size; unsigned int size; int64_t duration; int strings_size; @@ -565,7 +565,6 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header) uint32_t vsize; uint16_t asize; uint16_t auxsize; - uint32_t av_unused auxtag; av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header); @@ -595,6 +594,7 @@ null_chunk_retry: av_dlog(s, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize); /* skip aux stuff */ for (i = 0; i < auxcount; i++) { + uint32_t auxtag; auxsize = avio_rl16(pb); auxtag = avio_rl32(pb); av_dlog(s, "NSV aux data: '%c%c%c%c', %d bytes\n", diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 730ed14807..01514c1bef 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -113,7 +113,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, h264_data->level_idc = level_idc; } } else if (!strcmp(attr, "sprop-parameter-sets")) { - uint8_t start_sequence[]= { 0, 0, 1 }; + uint8_t start_sequence[] = { 0, 0, 0, 1 }; codec->extradata_size= 0; codec->extradata= NULL; @@ -176,7 +176,7 @@ static int h264_handle_packet(AVFormatContext *ctx, uint8_t nal = buf[0]; uint8_t type = (nal & 0x1f); int result= 0; - uint8_t start_sequence[]= {0, 0, 1}; + uint8_t start_sequence[] = { 0, 0, 0, 1 }; #ifdef DEBUG assert(data); |