Skip to content

Commit 49680b4

Browse files
committed
增强码流类型判断
1 parent 2c28ab5 commit 49680b4

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

ijkmedia/ijkplayer/ff_ffplay.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,27 +3830,28 @@ static int read_thread(void *arg)
38303830
}
38313831
}
38323832

3833-
38343833
//parse SEI message
3835-
if (pkt->stream_index == is->video_stream) {
3836-
3837-
uint8_t uuid[16];
3838-
uint8_t *content;
3839-
int size;
3840-
ret = parse_sei(pkt, uuid, &content, &size);
3841-
3842-
if (ret == 0 && size > 0 && content != NULL) {
3843-
// use content and uuid
3844-
/*printf(" SEI===CONT===%s \n SEI===UUID===",content);
3845-
for (int inddd = 0; inddd < 16; inddd++) {
3846-
printf("%02x ", uuid[inddd]);
3847-
}
3848-
printf("\n SEI===SIZE===%d \n",size);*/
3834+
if (is->video_st && is->video_st->codecpar) {
3835+
AVCodecParameters *in_codecpar = is->video_st->codecpar;
3836+
// if (in_codecpar->codec_type == AVMEDIA_TYPE_VIDEO && in_codecpar->codec_id == AV_CODEC_ID_H264) {
3837+
if (pkt->stream_index == is->video_stream && in_codecpar->codec_id == AV_CODEC_ID_H264) {
38493838

3850-
ffp_notify_msg4(ffp, FFP_MSG_VIDEO_SEI, 0, 0, content, size);
3839+
uint8_t uuid[16];
3840+
uint8_t *content;
3841+
int size;
3842+
ret = parse_sei(pkt, uuid, &content, &size);
3843+
3844+
if (ret == 0 && size > 0 && content != NULL) {
3845+
// use content and uuid
3846+
/*printf(" SEI===CONT===%s \n SEI===UUID===",content);
3847+
for (int inddd = 0; inddd < 16; inddd++) {
3848+
printf("%02x ", uuid[inddd]);
3849+
}
3850+
printf("\n SEI===SIZE===%d \n",size);*/
3851+
ffp_notify_msg4(ffp, FFP_MSG_VIDEO_SEI, 0, 0, content, size);
3852+
}
38513853
}
38523854
}
3853-
38543855

38553856
/* check if packet is in play range specified by user, then queue, otherwise discard */
38563857
stream_start_time = ic->streams[pkt->stream_index]->start_time;

0 commit comments

Comments
 (0)