Merge commit 'db0a943266be29ff0596872ebb418dfed75d00de'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 10 Feb 2013 11:47:02 +0000 (12:47 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 10 Feb 2013 11:47:37 +0000 (12:47 +0100)
* commit 'db0a943266be29ff0596872ebb418dfed75d00de':
  avplay: apply the stream sample_aspect_ratio to decoded video frames

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
ffplay.c

diff --cc ffplay.c
+++ b/ffplay.c
@@@ -1688,26 -1495,16 +1688,29 @@@ static int get_video_frame(VideoState *
          if (*pts == AV_NOPTS_VALUE) {
              *pts = 0;
          }
+         if (is->video_st->sample_aspect_ratio.num) {
+             frame->sample_aspect_ratio = is->video_st->sample_aspect_ratio;
+         }
  
 -        is->skip_frames_index += 1;
 -        if (is->skip_frames_index >= is->skip_frames) {
 -            is->skip_frames_index -= FFMAX(is->skip_frames, 1.0);
 -            return 1;
 +        if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {
 +            SDL_LockMutex(is->pictq_mutex);
 +            if (is->frame_last_pts != AV_NOPTS_VALUE && *pts) {
 +                double clockdiff = get_video_clock(is) - get_master_clock(is);
 +                double dpts = av_q2d(is->video_st->time_base) * *pts;
 +                double ptsdiff = dpts - is->frame_last_pts;
 +                if (fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
 +                     ptsdiff > 0 && ptsdiff < AV_NOSYNC_THRESHOLD &&
 +                     clockdiff + ptsdiff - is->frame_last_filter_delay < 0) {
 +                    is->frame_last_dropped_pos = pkt->pos;
 +                    is->frame_last_dropped_pts = dpts;
 +                    is->frame_drops_early++;
 +                    ret = 0;
 +                }
 +            }
 +            SDL_UnlockMutex(is->pictq_mutex);
          }
  
 +        return ret;
      }
      return 0;
  }