[MPlayer-cvslog] CVS: main/libmpdemux muxer_lavf.c,1.7,1.8

Nico Sabbi CVS syncmail at mplayerhq.hu
Tue May 17 23:44:30 CEST 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv20165

Modified Files:
	muxer_lavf.c 
Log Message:
mux extradata

Index: muxer_lavf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_lavf.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- muxer_lavf.c	1 May 2005 11:13:14 -0000	1.7
+++ muxer_lavf.c	17 May 2005 21:44:28 -0000	1.8
@@ -172,6 +172,18 @@
 			ctx->frame_size, stream->h.dwScale, ctx->sample_rate, stream->h.dwRate,
 			ctx->block_align, stream->wf->nBlockAlign, stream->wf->nAvgBytesPerSec);
 		ctx->block_align = stream->wf->nBlockAlign;
+		if(stream->wf+1 && stream->wf->cbSize)
+		{
+			ctx->extradata = av_malloc(stream->wf->cbSize);
+			if(ctx->extradata != NULL)
+			{
+				ctx->extradata_size = stream->wf->cbSize;
+				memcpy(ctx->extradata, stream->wf+1, ctx->extradata_size);
+			}
+			else
+				mp_msg(MSGT_MUXER, MSGL_ERR, "MUXER_LAVF(audio stream) error! couldn't allocate %d bytes for extradata\n",
+					stream->wf->cbSize);
+		}
 	}
 	else if(stream->type == MUXER_TYPE_VIDEO)
 	{
@@ -187,6 +199,18 @@
 		ctx->frame_rate = stream->h.dwRate;
 		ctx->frame_rate_base = stream->h.dwScale;
 #endif
+		if(stream->bih+1 && (stream->bih->biSize > sizeof(BITMAPINFOHEADER)))
+		{
+			ctx->extradata = av_malloc(stream->bih->biSize - sizeof(BITMAPINFOHEADER));
+			if(ctx->extradata != NULL)
+			{
+				ctx->extradata_size = stream->bih->biSize - sizeof(BITMAPINFOHEADER);
+				memcpy(ctx->extradata, stream->bih+1, ctx->extradata_size);
+			}
+			else
+				mp_msg(MSGT_MUXER, MSGL_ERR, "MUXER_LAVF(video stream) error! couldn't allocate %d bytes for extradata\n",
+					stream->bih->biSize - sizeof(BITMAPINFOHEADER));
+		}
 	}
 }
 




More information about the MPlayer-cvslog mailing list