Mercurial > mplayer.hg
changeset 33936:f27fe61c62f7
Replace deprecated functionality in muxer_lavf.
author | reimar |
---|---|
date | Sat, 27 Aug 2011 11:17:05 +0000 |
parents | ec503686b02d |
children | ab4b48ef5a68 |
files | libmpdemux/muxer_lavf.c |
diffstat | 1 files changed, 8 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c Sat Aug 27 11:04:53 2011 +0000 +++ b/libmpdemux/muxer_lavf.c Sat Aug 27 11:17:05 2011 +0000 @@ -48,7 +48,7 @@ typedef struct { //AVInputFormat *avif; AVFormatContext *oc; - ByteIOContext *pb; + AVIOContext *pb; int audio_streams; int video_streams; int64_t last_pts; @@ -284,7 +284,7 @@ muxer_priv_t *priv = (muxer_priv_t *) muxer->priv; mp_msg(MSGT_MUXER, MSGL_INFO, MSGTR_WritingHeader); - av_write_header(priv->oc); + avformat_write_header(priv->oc, NULL); muxer->cont_write_header = NULL; } @@ -355,25 +355,20 @@ priv->oc->oformat = fmt; - if(av_set_parameters(priv->oc, NULL) < 0) - { - mp_msg(MSGT_MUXER, MSGL_FATAL, "invalid output format parameters\n"); - goto fail; - } priv->oc->packet_size= mux_packet_size; priv->oc->mux_rate= mux_rate; priv->oc->preload= (int)(mux_preload*AV_TIME_BASE); priv->oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); if (info_name) - av_metadata_set2(&priv->oc->metadata, "title", info_name, 0); + av_dict_set(&priv->oc->metadata, "title", info_name, 0); if (info_artist) - av_metadata_set2(&priv->oc->metadata, "author", info_artist, 0); + av_dict_set(&priv->oc->metadata, "author", info_artist, 0); if (info_genre) - av_metadata_set2(&priv->oc->metadata, "genre", info_genre, 0); + av_dict_set(&priv->oc->metadata, "genre", info_genre, 0); if (info_copyright) - av_metadata_set2(&priv->oc->metadata, "copyright", info_copyright, 0); + av_dict_set(&priv->oc->metadata, "copyright", info_copyright, 0); if (info_comment) - av_metadata_set2(&priv->oc->metadata, "comment", info_comment, 0); + av_dict_set(&priv->oc->metadata, "comment", info_comment, 0); if(mux_avopt){ if(parse_avopts(priv->oc, mux_avopt) < 0){ @@ -382,7 +377,7 @@ } } - priv->oc->pb = av_alloc_put_byte(priv->buffer, BIO_BUFFER_SIZE, 1, muxer, NULL, mp_write, mp_seek); + priv->oc->pb = avio_alloc_context(priv->buffer, BIO_BUFFER_SIZE, 1, muxer, NULL, mp_write, mp_seek); if ((muxer->stream->flags & MP_STREAM_SEEK) != MP_STREAM_SEEK) priv->oc->pb->is_streamed = 1;