Schedule refreshes from a thread that actually knows the PTS.
Fixes wernfried_1.avi Originally committed as revision 21586 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
68aefbe81c
commit
b8bb398a40
7
ffplay.c
7
ffplay.c
@ -1061,8 +1061,7 @@ static void video_refresh_timer(void *opaque)
|
|||||||
|
|
||||||
if (is->video_st) {
|
if (is->video_st) {
|
||||||
if (is->pictq_size == 0) {
|
if (is->pictq_size == 0) {
|
||||||
/* if no picture, need to wait */
|
// fprintf(stderr, "Internal error detected in the SDL timer\n");
|
||||||
schedule_refresh(is, 1);
|
|
||||||
} else {
|
} else {
|
||||||
/* dequeue the picture */
|
/* dequeue the picture */
|
||||||
vp = &is->pictq[is->pictq_rindex];
|
vp = &is->pictq[is->pictq_rindex];
|
||||||
@ -1071,9 +1070,6 @@ static void video_refresh_timer(void *opaque)
|
|||||||
is->video_current_pts = vp->pts;
|
is->video_current_pts = vp->pts;
|
||||||
is->video_current_pts_drift = is->video_current_pts - av_gettime() / 1000000.0;
|
is->video_current_pts_drift = is->video_current_pts - av_gettime() / 1000000.0;
|
||||||
|
|
||||||
/* launch timer for next picture */
|
|
||||||
schedule_refresh(is, (int)(compute_frame_delay(vp->pts, is) * 1000 + 0.5));
|
|
||||||
|
|
||||||
if(is->subtitle_st) {
|
if(is->subtitle_st) {
|
||||||
if (is->subtitle_stream_changed) {
|
if (is->subtitle_stream_changed) {
|
||||||
SDL_LockMutex(is->subpq_mutex);
|
SDL_LockMutex(is->subpq_mutex);
|
||||||
@ -1282,6 +1278,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts)
|
|||||||
SDL_LockMutex(is->pictq_mutex);
|
SDL_LockMutex(is->pictq_mutex);
|
||||||
is->pictq_size++;
|
is->pictq_size++;
|
||||||
SDL_UnlockMutex(is->pictq_mutex);
|
SDL_UnlockMutex(is->pictq_mutex);
|
||||||
|
schedule_refresh(is, (int)(compute_frame_delay(vp->pts, is) * 1000 + 0.5));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user