summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-24 00:54:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-24 01:03:07 +0200
commita7758884db7eb3041b73d673c1ac3897609556b9 (patch)
treefbf882650e3d0607bd189ae571e402b55179f078 /libavformat
parentf7e797aa5c987c39b55666a2d41877ef2aec40bc (diff)
parent0c378ea1f76e226eff460c84634e7227e3705372 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtp: factorize dynamic payload type fallback flvdec: Ignore the index if it's from a creator known to be different cmdutils: move grow_array out of #if CONFIG_AVFILTER avconv: actually set InputFile.rate_emu ratecontrol: update last_qscale_for sooner Fix unnecessary shift with 9/10bit vertical scaling prores: mark prores as intra-only in libavformat/utils.c:is_intra_only() prores: return more meaningful error values prores: improve error message wording prores: cosmetics: prettyprinting, drop useless parentheses prores: lowercase AVCodec name entry Conflicts: cmdutils.c libavcodec/proresdec_lgpl.c tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c12
-rw-r--r--libavformat/rtp.c5
-rw-r--r--libavformat/rtpenc.c3
-rw-r--r--libavformat/sdp.c3
-rw-r--r--libavformat/utils.c2
5 files changed, 18 insertions, 7 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 74330e8658..828d25fda3 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -139,6 +139,18 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
int64_t *filepositions = NULL;
int ret = AVERROR(ENOSYS);
int64_t initial_pos = avio_tell(ioc);
+ AVDictionaryEntry *creator = av_dict_get(s->metadata, "metadatacreator",
+ NULL, 0);
+
+ if (creator && !strcmp(creator->value, "MEGA")) {
+ /* Files with this metadatacreator tag seem to have filepositions
+ * pointing at the 4 trailer bytes of the previous packet,
+ * which isn't the norm (nor what we expect here, nor what
+ * jwplayer + lighttpd expect, nor what flvtool2 produces).
+ * Just ignore the index in this case, instead of risking trying
+ * to adjust it to something that might or might not work. */
+ return 0;
+ }
while (avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
int64_t** current_array;
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 70c5e99704..ab815233ab 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -103,6 +103,11 @@ int ff_rtp_get_payload_type(AVCodecContext *codec)
continue;
payload_type = AVRtpPayloadTypes[i].pt;
}
+
+ /* dynamic payload type */
+ if (payload_type < 0)
+ payload_type = RTP_PT_PRIVATE + (codec->codec_type == AVMEDIA_TYPE_AUDIO);
+
return payload_type;
}
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index a99fca0aed..0cc68fc64a 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -93,9 +93,6 @@ static int rtp_write_header(AVFormatContext *s1)
}
s->payload_type = ff_rtp_get_payload_type(st->codec);
- if (s->payload_type < 0)
- s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == AVMEDIA_TYPE_AUDIO);
-
s->base_timestamp = av_get_random_seed();
s->timestamp = s->base_timestamp;
s->cur_timestamp = 0;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 32cef49916..fb351bb97b 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -533,9 +533,6 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des
int payload_type;
payload_type = ff_rtp_get_payload_type(c);
- if (payload_type < 0) {
- payload_type = RTP_PT_PRIVATE + (c->codec_type == AVMEDIA_TYPE_AUDIO);
- }
switch (c->codec_type) {
case AVMEDIA_TYPE_VIDEO : type = "video" ; break;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4dcf0ac2df..72990f6230 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -887,6 +887,7 @@ static int is_intra_only(AVCodecContext *enc){
case CODEC_ID_MJPEG:
case CODEC_ID_MJPEGB:
case CODEC_ID_LJPEG:
+ case CODEC_ID_PRORES:
case CODEC_ID_RAWVIDEO:
case CODEC_ID_DVVIDEO:
case CODEC_ID_HUFFYUV:
@@ -896,7 +897,6 @@ static int is_intra_only(AVCodecContext *enc){
case CODEC_ID_VCR1:
case CODEC_ID_DNXHD:
case CODEC_ID_JPEG2000:
- case CODEC_ID_PRORES:
return 1;
default: break;
}