From 8b9c89d331f5a2d6335ff9b08abc8d5c94428731 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Thu, 17 Aug 2017 23:46:23 +0300 Subject: [PATCH] flv: Split FrameType and CodecID values --- output/flv.c | 4 ++-- output/flv_bytestream.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/output/flv.c b/output/flv.c index dfe4d484..0057de4b 100644 --- a/output/flv.c +++ b/output/flv.c @@ -196,7 +196,7 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal ) flv_put_be24( c, 0 ); // StreamID - Always 0 p_flv->start = c->d_cur; // needed for overwriting length - flv_put_byte( c, 7 | FLV_FRAME_KEY ); // Frametype and CodecID + flv_put_byte( c, FLV_FRAME_KEY | FLV_CODECID_H264 ); // FrameType and CodecID flv_put_byte( c, 0 ); // AVC sequence header flv_put_be24( c, 0 ); // composition time @@ -279,7 +279,7 @@ static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_ flv_put_be24( c, 0 ); p_flv->start = c->d_cur; - flv_put_byte( c, p_picture->b_keyframe ? FLV_FRAME_KEY : FLV_FRAME_INTER ); + flv_put_byte( c, (p_picture->b_keyframe ? FLV_FRAME_KEY : FLV_FRAME_INTER) | FLV_CODECID_H264 ); flv_put_byte( c, 1 ); // AVC NALU flv_put_be24( c, offset ); diff --git a/output/flv_bytestream.h b/output/flv_bytestream.h index af22b09a..91e18ff4 100644 --- a/output/flv_bytestream.h +++ b/output/flv_bytestream.h @@ -90,8 +90,8 @@ enum enum { - FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET | 7, - FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET | 7, + FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, + FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, }; typedef enum -- 2.40.0