diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-03-29 17:10:30 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-03-31 12:48:15 +0000 |
commit | 42fcbd5597452189423055d816b0d7844f5886b2 (patch) | |
tree | 6018a0d07285341c6c60f0a80b1e9f9192c394ab /main/ffmpeg2.8/fix-flv-extradata.patch | |
parent | 57e965a9e88bb2e1b4e7b1d4aa51f10a22a8f59d (diff) | |
download | aports-42fcbd5597452189423055d816b0d7844f5886b2.tar.bz2 aports-42fcbd5597452189423055d816b0d7844f5886b2.tar.xz |
main/ffmpeg2.8: add old version of ffmpeg for vlc
Diffstat (limited to 'main/ffmpeg2.8/fix-flv-extradata.patch')
-rw-r--r-- | main/ffmpeg2.8/fix-flv-extradata.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/main/ffmpeg2.8/fix-flv-extradata.patch b/main/ffmpeg2.8/fix-flv-extradata.patch new file mode 100644 index 0000000000..2fe5b08bcc --- /dev/null +++ b/main/ffmpeg2.8/fix-flv-extradata.patch @@ -0,0 +1,44 @@ +https://trac.ffmpeg.org/ticket/3175 + +This patch is slightly cleaned up version of: +http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2014-May/157791.html + +diff -ru ffmpeg-2.3.4.orig/libavformat/flvenc.c ffmpeg-2.3.4/libavformat/flvenc.c +--- ffmpeg-2.3.4.orig/libavformat/flvenc.c 2014-10-03 04:49:20.000000000 -0300 ++++ ffmpeg-2.3.4/libavformat/flvenc.c 2014-12-04 11:37:23.286586875 -0200 +@@ -414,11 +414,35 @@ + if (enc->codec_id == AV_CODEC_ID_AAC) { + avio_w8(pb, get_audio_flags(s, enc)); + avio_w8(pb, 0); // AAC sequence header ++ if (enc->extradata_size < 2) { ++ static const int mpeg4audio_sample_rates[16] = { ++ 96000, 88200, 64000, 48000, 44100, 32000, ++ 24000, 22050, 16000, 12000, 11025, 8000, 7350 ++ }; ++ int sample_rate_index; ++ ++ av_log(s, AV_LOG_WARNING, "AAC extradata empty!.\n"); ++ for (sample_rate_index = 0; sample_rate_index < 16; sample_rate_index++) ++ if (enc->sample_rate == mpeg4audio_sample_rates[sample_rate_index]) ++ break; ++ ++ if (sample_rate_index < 16 && (enc->extradata = av_mallocz(2)) != NULL) { ++ enc->extradata_size = 2; ++ enc->extradata[0] = 0x10 | (sample_rate_index>>1); ++ enc->extradata[1] = (sample_rate_index & 0x01)<<7 | enc->channels <<3; ++ } ++ } ++ if (enc->extradata_size >= 2) ++ av_log(s, AV_LOG_DEBUG, "AAC extradata size %d: %02x:%02x.\n", enc->extradata_size, enc->extradata[0], enc->extradata[1]); + avio_write(pb, enc->extradata, enc->extradata_size); + } else { + avio_w8(pb, enc->codec_tag | FLV_FRAME_KEY); // flags + avio_w8(pb, 0); // AVC sequence header + avio_wb24(pb, 0); // composition time ++ if(enc->extradata_size>=2) ++ av_log(s, AV_LOG_DEBUG, "Video extradata size %d: %02x:%02x.\n", enc->extradata_size, enc->extradata[0], enc->extradata[1]); ++ else ++ av_log(s, AV_LOG_WARNING, "Video extradata empty!.\n"); + ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size); + } + data_size = avio_tell(pb) - pos; |