Mercurial > mplayer.hg
view libmpdemux/muxer_rawaudio.c @ 24424:0c4f1a88eaae
warning fixes:
input.c: In function 'mp_input_set_section':
input.c:1640: warning: suggest parentheses around assignment used as truth value
input.c:1643: warning: suggest parentheses around assignment used as truth value
mga_common.c: In function 'mga_init':
mga_common.c:394: warning: suggest parentheses around assignment used as truth value
playtreeparser.c: In function 'parse_smil':
playtreeparser.c:523: warning: suggest parentheses around assignment used as truth value
libmpdemux/demux_ts.c: In function 'ts_parse':
libmpdemux/demux_ts.c:2795: warning: suggest parentheses around assignment used as truth value
libmpdemux/demux_ts.c: In function 'demux_open_ts':
libmpdemux/demux_ts.c:591: warning: 'frame_length' may be used uninitialized in this function
author | diego |
---|---|
date | Thu, 13 Sep 2007 13:16:30 +0000 |
parents | 4d81dbdf46b9 |
children | d643e4643313 |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include "help_mp.h" #include "mp_msg.h" #include "aviheader.h" #include "ms_hdr.h" #include "stream/stream.h" #include "muxer.h" static muxer_stream_t* rawaudiofile_new_stream(muxer_t *muxer,int type){ muxer_stream_t* s; if (!muxer) return NULL; if(type==MUXER_TYPE_AUDIO && muxer->avih.dwStreams>=1){ mp_msg(MSGT_MUXER,MSGL_ERR,MSGTR_TooManyStreams" "MSGTR_RawMuxerOnlyOneStream); return NULL; } s=malloc(sizeof(muxer_stream_t)); memset(s,0,sizeof(muxer_stream_t)); if(!s) return NULL; // no mem!? muxer->streams[muxer->avih.dwStreams]=s; s->type=type; s->id=muxer->avih.dwStreams; s->timer=0.0; s->size=0; s->muxer=muxer; switch(type){ case MUXER_TYPE_AUDIO: s->ckid=mmioFOURCC(('0'+s->id/10),('0'+(s->id%10)),'d','c'); s->h.fccType=streamtypeAUDIO; muxer->avih.dwStreams++; break; case MUXER_TYPE_VIDEO: mp_msg(MSGT_MUXER,MSGL_WARN,MSGTR_IgnoringVideoStream); s->ckid=mmioFOURCC(('0'+s->id/10),('0'+(s->id%10)),'d','c'); s->h.fccType=streamtypeAUDIO; break; default: mp_msg(MSGT_MUXER,MSGL_ERR,MSGTR_UnknownStreamType,type); return NULL; } return s; } static void rawaudiofile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags, double dts, double pts){ muxer_t *muxer=s->muxer; // write out the chunk: if (s->type==MUXER_TYPE_AUDIO) stream_write_buffer(muxer->stream, s->buffer, len); } static void rawaudiofile_write_header(muxer_t *muxer){ return; } static void rawaudiofile_write_index(muxer_t *muxer){ return; } int muxer_init_muxer_rawaudio(muxer_t *muxer){ muxer->cont_new_stream = &rawaudiofile_new_stream; muxer->cont_write_chunk = &rawaudiofile_write_chunk; muxer->cont_write_header = &rawaudiofile_write_header; muxer->cont_write_index = &rawaudiofile_write_index; return 1; }