[MPlayer-cvslog] r34024 - trunk/libmpdemux/muxer_lavf.c

reimar subversion at mplayerhq.hu
Sat Aug 27 13:17:06 CEST 2011


Author: reimar
Date: Sat Aug 27 13:17:05 2011
New Revision: 34024

Log:
Replace deprecated functionality in muxer_lavf.

Modified:
   trunk/libmpdemux/muxer_lavf.c

Modified: trunk/libmpdemux/muxer_lavf.c
==============================================================================
--- trunk/libmpdemux/muxer_lavf.c	Sat Aug 27 13:04:53 2011	(r34023)
+++ trunk/libmpdemux/muxer_lavf.c	Sat Aug 27 13:17:05 2011	(r34024)
@@ -48,7 +48,7 @@ enum PixelFormat imgfmt2pixfmt(int fmt);
 typedef struct {
 	//AVInputFormat *avif;
 	AVFormatContext *oc;
-	ByteIOContext *pb;
+	AVIOContext *pb;
 	int audio_streams;
 	int video_streams;
 	int64_t last_pts;
@@ -284,7 +284,7 @@ static void write_header(muxer_t *muxer)
 	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 @@ int muxer_init_muxer_lavf(muxer_t *muxer
 	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 @@ int muxer_init_muxer_lavf(muxer_t *muxer
             }
         }
 
-	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;
 


More information about the MPlayer-cvslog mailing list