Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Jackarain/avplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Apr 16, 2012
2 parents 98f49ff + ac9e8b9 commit 3ffdf68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions avcore/player_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,11 @@ BOOL player_impl::open(LPCTSTR movie, int media_type, int video_out_type/* = 0*/
configure(m_avplay, m_audio, AUDIO_RENDER);

// 得到视频宽高.
m_video_width = m_avplay->m_video_ctx->width;
m_video_height = m_avplay->m_video_ctx->height;
if (m_avplay->m_video_ctx)
{
m_video_width = m_avplay->m_video_ctx->width;
m_video_height = m_avplay->m_video_ctx->height;
}

return TRUE;

Expand Down
6 changes: 4 additions & 2 deletions libav/src/avplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ audio_render* alloc_audio_render()

void free_audio_render(audio_render *render)
{
render->destory_audio(render->ctx);
if (render->ctx)
render->destory_audio(render->ctx);
free(render);
}

Expand All @@ -474,7 +475,8 @@ video_render* alloc_video_render(void *user_data)

void free_video_render(video_render *render)
{
render->destory_video(render->ctx);
if (render->ctx)
render->destory_video(render->ctx);
free(render);
}

Expand Down

0 comments on commit 3ffdf68

Please sign in to comment.