80,10 → 80,6 |
avdevice_register_all(); |
av_register_all(); |
|
#ifdef HAVE_VAAPI |
fplay_vaapi_init(); |
#endif |
|
if( avformat_open_input(&vst.fCtx, movie_file, NULL, NULL) < 0) |
{ |
printf("Cannot open file %s\n\r", movie_file); |
158,20 → 154,8 |
return -1; // Codec not found |
} |
|
#ifdef HAVE_VAAPI |
int hwdec = va_check_codec_support(vst.vCtx->codec_id); |
|
if(hwdec) |
{ |
printf("hardware decode supported\n"); |
|
if (fplay_init_context(&vst) < 0) |
{ |
printf("context initialization failed\n"); |
if(fplay_init_context(&vst)) |
return -1; |
}; |
}; |
#endif |
|
if(avcodec_open2(vst.vCtx, vst.vCodec, NULL) < 0) |
{ |
180,6 → 164,7 |
return -1; // Could not open codec |
}; |
|
printf("ctx->pix_fmt %d\n", vst.vCtx->pix_fmt); |
|
mutex_init(&vst.q_video.lock); |
mutex_init(&vst.q_audio.lock); |