Commit 747a0554 authored by Tinic Uro's avatar Tinic Uro Committed by Michael Niedermayer

- made --extra-cflags option work on darwin

- allow INTER4V macroblocks for FLV1 codec
- fixed issue in flv file format saving 8 mp3 frames per packet instead of 1
- fixed crasher in flv file format involving mp3 buffer handling
- added FLV1 codec support for swf file format (FlashPlayer6 or above
required) and made it default
- fixed broken mp3 support in swf file format
patch by (Tinic Uro <turo at macromedia dot com>)
cleanup by me

Originally committed as revision 2756 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8cb5d4c0
...@@ -431,21 +431,21 @@ fi ...@@ -431,21 +431,21 @@ fi
needmdynamicnopic="no" needmdynamicnopic="no"
if test $targetos = Darwin; then if test $targetos = Darwin; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then if test -n "`$cc -v 2>&1 | grep xlc`"; then
CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto" CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else else
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in case "$gcc_version" in
*2.95*) *2.95*)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer" CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
;; ;;
*3.*) *3.*)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare" CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then if test "$lshared" = no; then
needmdynamicnopic="yes" needmdynamicnopic="yes"
fi fi
;; ;;
*) *)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer" CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
if test "$lshared" = no; then if test "$lshared" = no; then
needmdynamicnopic="yes" needmdynamicnopic="yes"
fi fi
......
...@@ -748,7 +748,7 @@ int MPV_encode_init(AVCodecContext *avctx) ...@@ -748,7 +748,7 @@ int MPV_encode_init(AVCodecContext *avctx)
} }
if((s->flags & CODEC_FLAG_4MV) && s->codec_id != CODEC_ID_MPEG4 if((s->flags & CODEC_FLAG_4MV) && s->codec_id != CODEC_ID_MPEG4
&& s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P){ && s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P && s->codec_id != CODEC_ID_FLV1){
av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n"); av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
return -1; return -1;
} }
......
...@@ -121,7 +121,7 @@ static int mp3info(void *data, int *byteSize, int *samplesPerFrame, int *sampleR ...@@ -121,7 +121,7 @@ static int mp3info(void *data, int *byteSize, int *samplesPerFrame, int *sampleR
} }
} }
*byteSize = ( ( ( ( *samplesPerFrame * (bitRate / bitsPerSlot) ) / *sampleRate ) + isPadded ) * bitsPerSlot); *byteSize = ( ( ( ( *samplesPerFrame * (bitRate / bitsPerSlot) ) / *sampleRate ) + isPadded ) );
return 1; return 1;
} }
...@@ -295,8 +295,15 @@ static int flv_write_packet(AVFormatContext *s, int stream_index, ...@@ -295,8 +295,15 @@ static int flv_write_packet(AVFormatContext *s, int stream_index,
int mp3SampleRate = 0; int mp3SampleRate = 0;
int mp3IsMono = 0; int mp3IsMono = 0;
int mp3SamplesPerFrame = 0; int mp3SamplesPerFrame = 0;
int c=0;
/* copy out mp3 header from ring buffer */
uint8_t header[4];
for (c=0; c<4; c++) {
header[c] = flv->audio_fifo[(flv->audioInPos+c) % AUDIO_FIFO_SIZE];
}
if ( mp3info(&flv->audioFifo[flv->audioInPos],&mp3FrameSize,&mp3SamplesPerFrame,&mp3SampleRate,&mp3IsMono) ) { if ( mp3info(header,&mp3FrameSize,&mp3SamplesPerFrame,&mp3SampleRate,&mp3IsMono) ) {
if ( flv->audioSize >= mp3FrameSize ) { if ( flv->audioSize >= mp3FrameSize ) {
int soundFormat = 0x22; int soundFormat = 0x22;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment