X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fbink.c;h=b95c83d97ded8585a654dded59b2429fe49e0d8b;hb=323b8c95e41094b90ed2a9bdd9a06d22d2f74856;hp=332edbb7d918e7c2e42e696bcad97303a983a348;hpb=745d0c0300852e902199f39d282dc60e64b8c208;p=ffmpeg diff --git a/libavformat/bink.c b/libavformat/bink.c index 332edbb7d91..b95c83d97de 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -89,7 +89,7 @@ static int read_header(AVFormatContext *s) if (!vst) return AVERROR(ENOMEM); - vst->codec->codec_tag = avio_rl32(pb); + vst->codecpar->codec_tag = avio_rl32(pb); bink->file_size = avio_rl32(pb) + 8; vst->duration = avio_rl32(pb); @@ -107,8 +107,8 @@ static int read_header(AVFormatContext *s) avio_skip(pb, 4); - vst->codec->width = avio_rl32(pb); - vst->codec->height = avio_rl32(pb); + vst->codecpar->width = avio_rl32(pb); + vst->codecpar->height = avio_rl32(pb); fps_num = avio_rl32(pb); fps_den = avio_rl32(pb); @@ -121,15 +121,15 @@ static int read_header(AVFormatContext *s) avpriv_set_pts_info(vst, 64, fps_den, fps_num); vst->avg_frame_rate = av_inv_q(vst->time_base); - vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; - vst->codec->codec_id = AV_CODEC_ID_BINKVIDEO; + vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + vst->codecpar->codec_id = AV_CODEC_ID_BINKVIDEO; - if ((vst->codec->codec_tag & 0xFFFFFF) == MKTAG('K', 'B', '2', 0)) { + if ((vst->codecpar->codec_tag & 0xFFFFFF) == MKTAG('K', 'B', '2', 0)) { av_log(s, AV_LOG_WARNING, "Bink 2 video is not implemented\n"); - vst->codec->codec_id = AV_CODEC_ID_NONE; + vst->codecpar->codec_id = AV_CODEC_ID_NONE; } - if (ff_get_extradata(vst->codec, pb, 4) < 0) + if (ff_get_extradata(s, vst->codecpar, pb, 4) < 0) return AVERROR(ENOMEM); bink->num_audio_tracks = avio_rl32(pb); @@ -148,23 +148,23 @@ static int read_header(AVFormatContext *s) ast = avformat_new_stream(s, NULL); if (!ast) return AVERROR(ENOMEM); - ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; - ast->codec->codec_tag = 0; - ast->codec->sample_rate = avio_rl16(pb); - avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate); + ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + ast->codecpar->codec_tag = 0; + ast->codecpar->sample_rate = avio_rl16(pb); + avpriv_set_pts_info(ast, 64, 1, ast->codecpar->sample_rate); flags = avio_rl16(pb); - ast->codec->codec_id = flags & BINK_AUD_USEDCT ? + ast->codecpar->codec_id = flags & BINK_AUD_USEDCT ? AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT; if (flags & BINK_AUD_STEREO) { - ast->codec->channels = 2; - ast->codec->channel_layout = AV_CH_LAYOUT_STEREO; + ast->codecpar->channels = 2; + ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; } else { - ast->codec->channels = 1; - ast->codec->channel_layout = AV_CH_LAYOUT_MONO; + ast->codecpar->channels = 1; + ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO; } - if (ff_alloc_extradata(ast->codec, 4)) + if (ff_alloc_extradata(ast->codecpar, 4)) return AVERROR(ENOMEM); - AV_WL32(ast->codec->extradata, vst->codec->codec_tag); + AV_WL32(ast->codecpar->extradata, vst->codecpar->codec_tag); } for (i = 0; i < bink->num_audio_tracks; i++) @@ -250,7 +250,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) (in bytes). We use this value to calcuate the audio PTS */ if (pkt->size >= 4) bink->audio_pts[bink->current_track -1] += - AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels); + AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codecpar->channels); return 0; } else { avio_skip(pb, audio_size);