Skip to content

Commit

Permalink
fix(avformatdemuxer): try to get start_time when invalid
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed May 26, 2020
1 parent 94b08d2 commit 80f2436
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions framework/demuxer/avFormatDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ namespace Cicada {
}

if (packet->getInfo().pts != INT64_MIN) {
if (mCtx->start_time == INT64_MIN) {
mCtx->start_time = packet->getInfo().pts;
}
packet->getInfo().timePosition = packet->getInfo().pts - mCtx->start_time;
}

Expand Down Expand Up @@ -477,6 +480,9 @@ namespace Cicada {

mPacketQueue.clear();
mError = 0;
if (mCtx->start_time == INT64_MIN) {
mCtx->start_time = 0;
}
static const int jitter = 2;
int64_t timestamp = mCtx->start_time + us;
int64_t timestamp_seek;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
android:singleLine="true"
android:background="@drawable/shape_edit_bg"
android:hint="http://player.alicdn.com/video/aliyunmedia.mp4"
android:text="https://tryings01e01-4k-h265.oss-cn-shenzhen.aliyuncs.com/TryingS01E01_4k_H265.mp4"
android:text="http://player.alicdn.com/video/aliyunmedia.mp4"
android:maxLines="1" />

<Button
Expand Down

0 comments on commit 80f2436

Please sign in to comment.