diff options
author | wm4 <wm4@nowhere> | 2016-02-15 20:34:45 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-02-15 20:34:45 +0100 |
commit | f2b039da77fc66119d556e575822c2b8d328cdaf (patch) | |
tree | 658de5151cc968bfeb79f222a181afac926b390b /video | |
parent | f219a48dca7dbd525c1611b1d579947a3dd9b82b (diff) | |
download | mpv-f2b039da77fc66119d556e575822c2b8d328cdaf.tar.bz2 mpv-f2b039da77fc66119d556e575822c2b8d328cdaf.tar.xz |
audio/video: expose codec info as separate field
Preparation for the timeline rewrite. The codec will be able to change,
the stream header not.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/dec_video.c | 8 | ||||
-rw-r--r-- | video/decode/dec_video.h | 1 | ||||
-rw-r--r-- | video/decode/vd_lavc.c | 7 |
3 files changed, 8 insertions, 8 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 05de748e69..0487ac383f 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -136,7 +136,7 @@ bool video_init_best_codec(struct dec_video *d_video) struct mp_decoder_entry *decoder = NULL; struct mp_decoder_list *list = - mp_select_video_decoders(d_video->header->codec->codec, opts->video_decoders); + mp_select_video_decoders(d_video->codec->codec, opts->video_decoders); mp_print_decoders(d_video->log, MSGL_V, "Codec list:", list); @@ -164,7 +164,7 @@ bool video_init_best_codec(struct dec_video *d_video) MP_VERBOSE(d_video, "Selected video codec: %s\n", d_video->decoder_desc); } else { MP_ERR(d_video, "Failed to initialize a video decoder for codec '%s'.\n", - d_video->header->codec->codec); + d_video->codec->codec); } if (d_video->header->missing_timestamps) { @@ -182,7 +182,7 @@ static void fix_image_params(struct dec_video *d_video, { struct MPOpts *opts = d_video->opts; struct mp_image_params p = *params; - struct mp_codec_params *c = d_video->header->codec; + struct mp_codec_params *c = d_video->codec; MP_VERBOSE(d_video, "Decoder format: %s\n", mp_image_params_to_str(params)); @@ -241,7 +241,7 @@ static struct mp_image *decode_packet(struct dec_video *d_video, int drop_frame) { struct MPOpts *opts = d_video->opts; - bool avi_pts = d_video->header->codec->avi_dts && opts->correct_pts; + bool avi_pts = d_video->codec->avi_dts && opts->correct_pts; struct demux_packet packet_copy; if (packet && packet->dts == MP_NOPTS_VALUE && !avi_pts) { diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 9d69e0c73b..d4c12a7bc4 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -34,6 +34,7 @@ struct dec_video { const struct vd_functions *vd_driver; struct mp_hwdec_info *hwdec_info; // video output hwdec handles struct sh_stream *header; + struct mp_codec_params *codec; char *decoder_desc; diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 2a7928b96e..ef713c2d65 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -359,8 +359,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder, vd_ffmpeg_ctx *ctx = vd->priv; struct vd_lavc_params *lavc_param = vd->opts->vd_lavc_params; bool mp_rawvideo = false; - struct sh_stream *sh = vd->header; - struct mp_codec_params *c = sh->codec; + struct mp_codec_params *c = vd->codec; assert(!ctx->avctx); @@ -522,8 +521,8 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, .gamma = avcol_trc_to_mp_csp_trc(ctx->avctx->color_trc), .chroma_location = avchroma_location_to_mp(ctx->avctx->chroma_sample_location), - .rotate = vd->header->codec->rotate, - .stereo_in = vd->header->codec->stereo_mode, + .rotate = vd->codec->rotate, + .stereo_in = vd->codec->stereo_mode, }; if (opts->video_rotate < 0) { |