changeset 3099:a2a116fee880 libavcodec

create adts stream if CODEC_FLAG_GLOBAL_HEADER not set
author mru
date Wed, 08 Feb 2006 01:10:07 +0000
parents eb3d3988aff2
children 3c40c240a267
files faac.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/faac.c	Wed Feb 08 00:50:22 2006 +0000
+++ b/faac.c	Wed Feb 08 01:10:07 2006 +0000
@@ -62,14 +62,9 @@
         faac_cfg->bitRate = 0;
         faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA;
     }
-    faac_cfg->outputFormat = 0;
+    faac_cfg->outputFormat = 1;
     faac_cfg->inputFormat = FAAC_INPUT_16BIT;
 
-    if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
-        av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
-        return -1;
-    }
-
     avctx->frame_size = samples_input / avctx->channels;
 
     avctx->coded_frame= avcodec_alloc_frame();
@@ -86,9 +81,15 @@
                                            &decoder_specific_info_size)) {
             avctx->extradata = buffer;
             avctx->extradata_size = decoder_specific_info_size;
+            faac_cfg->outputFormat = 0;
         }
     }
 
+    if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
+        av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
+        return -1;
+    }
+
     return 0;
 }