From 9fdb6cd5badb9507e41c955605700a6604340d60 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 20 Apr 2015 15:35:58 -0500 Subject: [PATCH] FS-7519: support vb for video bitrate --- src/mod/formats/mod_avformat/mod_avformat.c | 22 ++++++--------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/mod/formats/mod_avformat/mod_avformat.c b/src/mod/formats/mod_avformat/mod_avformat.c index abeec3633e..3a397637f8 100644 --- a/src/mod/formats/mod_avformat/mod_avformat.c +++ b/src/mod/formats/mod_avformat/mod_avformat.c @@ -604,13 +604,8 @@ SWITCH_STANDARD_APP(record_av_function) const AVCodecDescriptor *desc; if (!strncmp(data, "rtmp://", 7)) { - if (fmt->video_codec != AV_CODEC_ID_H264 ) { - fmt->video_codec = AV_CODEC_ID_H264; // force H264 - } - - if (fmt->audio_codec != AV_CODEC_ID_AAC) { - fmt->audio_codec = AV_CODEC_ID_AAC; // force AAC - } + fmt->video_codec = AV_CODEC_ID_H264; + fmt->audio_codec = AV_CODEC_ID_AAC; } desc = avcodec_descriptor_get(fmt->video_codec); @@ -1212,17 +1207,13 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa if (fmt->video_codec != AV_CODEC_ID_H264 ) { fmt->video_codec = AV_CODEC_ID_H264; // force H264 } - - if (fmt->audio_codec != AV_CODEC_ID_AAC) { - fmt->audio_codec = AV_CODEC_ID_AAC; // force AAC - } - - - + + fmt->audio_codec = AV_CODEC_ID_AAC; + handle->mm.samplerate = 44100; handle->mm.ab = 128; - if (handle->mm.vw && handle->mm.vh) { + if (!handle->mm.vb && handle->mm.vw && handle->mm.vh) { switch(handle->mm.vh) { case 240: handle->mm.vb = 400; @@ -1248,7 +1239,6 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa if (handle->mm.fps > 0.0f) { handle->mm.keyint = (int) 2.0f * handle->mm.fps; } - } desc = avcodec_descriptor_get(fmt->video_codec);