Skip to content

Commit

Permalink
fix video frame drop problem
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Nov 29, 2012
1 parent 9fc28dd commit 9998972
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 0 additions & 7 deletions libav/avplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ enum bool_type
};
#endif

enum sync_type
{
AV_SYNC_AUDIO_MASTER, /* 默认选择. */
AV_SYNC_VIDEO_MASTER, /* 同步到视频时间戳. */
AV_SYNC_EXTERNAL_CLOCK, /* 同步到外部时钟. */
};

/* 队列类型. */
#define QUEUE_PACKET 0
#define QUEUE_AVFRAME 1
Expand Down
7 changes: 7 additions & 0 deletions libav/avplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ typedef enum play_status
inited, playing, paused, completed, stoped
} play_status;

enum sync_type
{
AV_SYNC_AUDIO_MASTER, /* 默认选择. */
AV_SYNC_VIDEO_MASTER, /* 同步到视频时间戳. */
AV_SYNC_EXTERNAL_CLOCK, /* 同步到外部时钟. */
};

/* 用于config_render参数表示所配置的render. */
#define MEDIA_SOURCE 0
#define AUDIO_RENDER 1
Expand Down
2 changes: 2 additions & 0 deletions linux/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ int player::open(const char* movie, int media_type)
// 打开视频实时码率和帧率计算.
enable_calc_frame_rate(m_avplay);
enable_calc_bit_rate(m_avplay);
//FIXME, don't know why audio sync cause frame drop
m_avplay->m_av_sync_type = AV_SYNC_VIDEO_MASTER;

return 0;

Expand Down

0 comments on commit 9998972

Please sign in to comment.