diff mbox

[FFmpeg-devel,1/2] avformat/flvenc: add FLVFlags for flvflags options

Message ID CADxeRw=PTT0NKfLBpriJyRgo6ag_=vXCXiyTVMkD1vBYwabJDw@mail.gmail.com
State Accepted
Headers show

Commit Message

Steven Liu Sept. 13, 2016, 2:09 p.m. UTC
add FLVFlags type, be used to add new FLVFlags options

Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
---
 libavformat/flvenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

                 int samplerate_index;
                 int channels = flv->audio_par->channels
@@ -718,7 +722,7 @@ static int flv_write_packet(AVFormatContext *s,
AVPacket *pkt)

 static const AVOption options[] = {
     { "flvflags", "FLV muxer flags", offsetof(FLVContext, flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
-    { "aac_seq_header_detect", "Put AAC sequence header based on stream
data", 0, AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
+    { "aac_seq_header_detect", "Put AAC sequence header based on stream
data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN,
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
     { NULL },
 };

--
2.7.4 (Apple Git-66)

Comments

Michael Niedermayer Sept. 13, 2016, 11:58 p.m. UTC | #1
On Tue, Sep 13, 2016 at 10:09:48PM +0800, Steven Liu wrote:
> add FLVFlags type, be used to add new FLVFlags options
> 
> Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
> ---
>  libavformat/flvenc.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

applied

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index ccbcf64..a3623f8 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -61,6 +61,10 @@  static const AVCodecTag flv_audio_codec_ids[] = {
     { AV_CODEC_ID_NONE,       0 }
 };

+typedef enum {
+    FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
+} FLVFlags;
+
 typedef struct FLVContext {
     AVClass *av_class;
     int     reserved;
@@ -364,7 +368,7 @@  static void flv_write_codec_header(AVFormatContext* s,
AVCodecParameters* par) {
             avio_w8(pb, get_audio_flags(s, par));
             avio_w8(pb, 0); // AAC sequence header

-            if (!par->extradata_size && flv->flags & 1) {
+            if (!par->extradata_size && flv->flags &
FLV_AAC_SEQ_HEADER_DETECT) {
                 PutBitContext pbc;