[FFmpeg-devel] [vaapi-cavs 3/7] cavs: time code debug
jianfeng.zheng
ggjogh at gmail.com
Sun Jan 21 16:18:42 EET 2024
Signed-off-by: jianfeng.zheng <jianfeng.zheng at mthreads.com>
---
libavcodec/cavsdec.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 9742bd1011..9ad0f29b01 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -1061,6 +1061,7 @@ static int decode_pic(AVSContext *h)
int ret;
int skip_count = -1;
enum cavs_mb mb_type;
+ char tc[4];
if (!h->top_qp) {
av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
@@ -1082,8 +1083,16 @@ static int decode_pic(AVSContext *h)
return AVERROR_INVALIDDATA;
} else {
h->cur.f->pict_type = AV_PICTURE_TYPE_I;
- if (get_bits1(&h->gb))
- skip_bits(&h->gb, 24);//time_code
+ if (get_bits1(&h->gb)) { //time_code
+ skip_bits(&h->gb, 1);
+ tc[0] = get_bits(&h->gb, 5);
+ tc[1] = get_bits(&h->gb, 6);
+ tc[2] = get_bits(&h->gb, 6);
+ tc[3] = get_bits(&h->gb, 6);
+ av_log(h->avctx, AV_LOG_DEBUG, "timecode: %d:%d:%d.%d\n",
+ tc[0], tc[1], tc[2], tc[3]);
+ }
+
/* old sample clips were all progressive and no low_delay,
bump stream revision if detected otherwise */
if (h->low_delay || !(show_bits(&h->gb, 9) & 1))
--
2.25.1
More information about the ffmpeg-devel
mailing list