Skip to content

Commit

Permalink
feat(las): support video_tool_box by adding side data
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwenjunwu committed Nov 5, 2020
1 parent bacab36 commit be38007
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ijkmedia/ijkplayer/ijkavformat/ijklas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,15 +1931,22 @@ static int las_read_packet(AVFormatContext* s, AVPacket* pkt) {
} else {
// go packet
*pkt = playlist->pkt;
if (pkt->stream_index >= 0 && pkt->stream_index < MAX_STREAM_NUM) {
pkt->stream_index = playlist->stream_index_map[pkt->stream_index];
}
AVCodecParameters* codec = playlist->ctx->streams[pkt->stream_index]->codecpar;
if (codec->extradata) {
uint8_t *side = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, codec->extradata_size);
if (side) {
memcpy(side, codec->extradata, codec->extradata_size);
av_freep(&codec->extradata);
codec->extradata_size = 0;
}
}
break;
}
}
reset_packet(&playlist->pkt);

if (pkt->stream_index >= 0 && pkt->stream_index < MAX_STREAM_NUM) {
pkt->stream_index = playlist->stream_index_map[pkt->stream_index];
}

LasStatistic_on_read_packet(playlist->las_statistic, playlist);

fail:
Expand Down

0 comments on commit be38007

Please sign in to comment.