aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-01 14:53:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-01 15:30:51 +0200
commit921d5ae3bcff07acb88d2e2767047c6b942c31bc (patch)
treef52e61137e33084fc6477f8434106a5d9deae2ab
parent9fb45334fc534ec24137d27abcc1ba8ef3170a77 (diff)
downloadffmpeg-921d5ae3bcff07acb88d2e2767047c6b942c31bc.tar.gz
ffmpeg: replace remaining, ffmpeg specific ist->st->codec by ist->dec_ctx
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffmpeg.c28
-rw-r--r--ffmpeg_filter.c14
2 files changed, 21 insertions, 21 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f667bd8c7b..2252280241 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -243,7 +243,7 @@ static void sub2video_update(InputStream *ist, AVSubtitle *sub)
num_rects = 0;
}
if (sub2video_get_blank_frame(ist) < 0) {
- av_log(ist->st->codec, AV_LOG_ERROR,
+ av_log(ist->dec_ctx, AV_LOG_ERROR,
"Impossible to get a blank canvas.\n");
return;
}
@@ -1634,11 +1634,11 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
opkt.dts -= ost_tb_start_time;
if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->dts != AV_NOPTS_VALUE) {
- int duration = av_get_audio_frame_duration(ist->st->codec, pkt->size);
+ int duration = av_get_audio_frame_duration(ist->dec_ctx, pkt->size);
if(!duration)
- duration = ist->st->codec->frame_size;
+ duration = ist->dec_ctx->frame_size;
opkt.dts = opkt.pts = av_rescale_delta(ist->st->time_base, pkt->dts,
- (AVRational){1, ist->st->codec->sample_rate}, duration, &ist->filter_in_rescale_delta_last,
+ (AVRational){1, ist->dec_ctx->sample_rate}, duration, &ist->filter_in_rescale_delta_last,
ost->st->time_base) - ost_tb_start_time;
}
@@ -1977,7 +1977,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
end = av_rescale(subtitle.pts - ist->prev_sub.subtitle.pts,
1000, AV_TIME_BASE);
if (end < ist->prev_sub.subtitle.end_display_time) {
- av_log(ist->st->codec, AV_LOG_DEBUG,
+ av_log(ist->dec_ctx, AV_LOG_DEBUG,
"Subtitle duration reduced from %d to %d%s\n",
ist->prev_sub.subtitle.end_display_time, end,
end <= 0 ? ", dropping it" : "");
@@ -2024,7 +2024,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
AVPacket avpkt;
if (!ist->saw_first_ts) {
- ist->dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
+ ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
ist->pts = 0;
if (pkt != NULL && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q);
@@ -2050,7 +2050,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
if (pkt->dts != AV_NOPTS_VALUE) {
ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
- if (ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
+ if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
ist->next_pts = ist->pts = ist->dts;
}
@@ -2108,7 +2108,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
// touch data and size only if not EOF
if (pkt) {
- if(ist->st->codec->codec_type != AVMEDIA_TYPE_AUDIO)
+ if(ist->dec_ctx->codec_type != AVMEDIA_TYPE_AUDIO)
ret = avpkt.size;
avpkt.data += ret;
avpkt.size -= ret;
@@ -3294,7 +3294,7 @@ static int process_input(int file_index)
if (debug_ts) {
av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s "
"next_dts:%s next_dts_time:%s next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%s off_time:%s\n",
- ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->st->codec->codec_type),
+ ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->dec_ctx->codec_type),
av_ts2str(ist->next_dts), av_ts2timestr(ist->next_dts, &AV_TIME_BASE_Q),
av_ts2str(ist->next_pts), av_ts2timestr(ist->next_pts, &AV_TIME_BASE_Q),
av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ist->st->time_base),
@@ -3372,7 +3372,7 @@ static int process_input(int file_index)
int64_t delta = pkt_dts - ifile->last_ts;
if(delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
(delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
- ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)){
+ ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)){
ifile->ts_offset -= delta;
av_log(NULL, AV_LOG_DEBUG,
"Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
@@ -3390,7 +3390,7 @@ static int process_input(int file_index)
if (is->iformat->flags & AVFMT_TS_DISCONT) {
if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
(delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
- ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
+ ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
ifile->ts_offset -= delta;
av_log(NULL, AV_LOG_DEBUG,
@@ -3402,7 +3402,7 @@ static int process_input(int file_index)
}
} else {
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
- (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
+ (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt.dts, ist->next_dts, pkt.stream_index);
pkt.dts = AV_NOPTS_VALUE;
}
@@ -3410,7 +3410,7 @@ static int process_input(int file_index)
int64_t pkt_pts = av_rescale_q(pkt.pts, ist->st->time_base, AV_TIME_BASE_Q);
delta = pkt_pts - ist->next_dts;
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
- (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
+ (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt.pts, ist->next_dts, pkt.stream_index);
pkt.pts = AV_NOPTS_VALUE;
}
@@ -3423,7 +3423,7 @@ static int process_input(int file_index)
if (debug_ts) {
av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%s off_time:%s\n",
- ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->st->codec->codec_type),
+ ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->dec_ctx->codec_type),
av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ist->st->time_base),
av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ist->st->time_base),
av_ts2str(input_files[ist->file_index]->ts_offset),
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index bbb05b28e2..68cf4f227c 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -595,8 +595,8 @@ static int sub2video_prepare(InputStream *ist)
/* Compute the size of the canvas for the subtitles stream.
If the subtitles codec has set a size, use it. Otherwise use the
maximum dimensions of the video streams in the same file. */
- w = ist->st->codec->width;
- h = ist->st->codec->height;
+ w = ist->dec_ctx->width;
+ h = ist->dec_ctx->height;
if (!(w && h)) {
for (i = 0; i < avf->nb_streams; i++) {
if (avf->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -610,12 +610,12 @@ static int sub2video_prepare(InputStream *ist)
}
av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
}
- ist->sub2video.w = ist->st->codec->width = ist->resample_width = w;
- ist->sub2video.h = ist->st->codec->height = ist->resample_height = h;
+ ist->sub2video.w = ist->dec_ctx->width = ist->resample_width = w;
+ ist->sub2video.h = ist->dec_ctx->height = ist->resample_height = h;
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
palettes for all rectangles are identical or compatible */
- ist->resample_pix_fmt = ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
+ ist->resample_pix_fmt = ist->dec_ctx->pix_fmt = AV_PIX_FMT_RGB32;
ist->sub2video.frame = av_frame_alloc();
if (!ist->sub2video.frame)
@@ -638,7 +638,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
char name[255];
int ret, pad_idx = 0;
- if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
return AVERROR(EINVAL);
}
@@ -646,7 +646,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
if (!fr.num)
fr = av_guess_frame_rate(input_files[ist->file_index]->ctx, ist->st, NULL);
- if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+ if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
ret = sub2video_prepare(ist);
if (ret < 0)
return ret;