[x264-devel] flv: Split FrameType and CodecID values

Anton Mitrofanov git at videolan.org
Mon Dec 25 20:39:48 CET 2017


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Thu Aug 17 23:46:23 2017 +0300| [8b9c89d331f5a2d6335ff9b08abc8d5c94428731] | committer: Anton Mitrofanov

flv: Split FrameType and CodecID values

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=8b9c89d331f5a2d6335ff9b08abc8d5c94428731
---

 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



More information about the x264-devel mailing list