if (ret >= 0) {
AVRational tb = (AVRational){1, frame->sample_rate};
if (frame->pts != AV_NOPTS_VALUE)
- frame->pts = av_rescale_q(frame->pts, av_codec_get_pkt_timebase(d->avctx), tb);
+ frame->pts = av_rescale_q(frame->pts, d->avctx->pkt_timebase, tb);
else if (d->next_pts != AV_NOPTS_VALUE)
frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, tb);
if (frame->pts != AV_NOPTS_VALUE) {
SDL_DestroyRenderer(renderer);
if (window)
SDL_DestroyWindow(window);
- av_lockmgr_register(NULL);
uninit_opts();
#if CONFIG_AVFILTER
av_freep(&vfilters_list);
ret = avcodec_parameters_to_context(avctx, ic->streams[stream_index]->codecpar);
if (ret < 0)
goto fail;
- av_codec_set_pkt_timebase(avctx, ic->streams[stream_index]->time_base);
+ avctx->pkt_timebase = ic->streams[stream_index]->time_base;
codec = avcodec_find_decoder(avctx->codec_id);
}
avctx->codec_id = codec->id;
- if(stream_lowres > av_codec_get_max_lowres(codec)){
+ if (stream_lowres > codec->max_lowres) {
av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n",
- av_codec_get_max_lowres(codec));
- stream_lowres = av_codec_get_max_lowres(codec);
+ codec->max_lowres);
+ stream_lowres = codec->max_lowres;
}
- av_codec_set_lowres(avctx, stream_lowres);
+ avctx->lowres = stream_lowres;
if (fast)
avctx->flags2 |= AV_CODEC_FLAG2_FAST;
);
}
-static int lockmgr(void **mtx, enum AVLockOp op)
-{
- switch(op) {
- case AV_LOCK_CREATE:
- *mtx = SDL_CreateMutex();
- if(!*mtx) {
- av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
- return 1;
- }
- return 0;
- case AV_LOCK_OBTAIN:
- return !!SDL_LockMutex(*mtx);
- case AV_LOCK_RELEASE:
- return !!SDL_UnlockMutex(*mtx);
- case AV_LOCK_DESTROY:
- SDL_DestroyMutex(*mtx);
- return 0;
- }
- return 1;
-}
-
/* Called from the main */
int main(int argc, char **argv)
{
SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
- if (av_lockmgr_register(lockmgr)) {
- av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n");
- do_exit(NULL);
- }
-
av_init_packet(&flush_pkt);
flush_pkt.data = (uint8_t *)&flush_pkt;