mirror of
https://github.com/mpv-player/mpv
synced 2025-03-29 15:00:27 +00:00
processing audio is sometimes essential for a/v sync, so 1000l to
whoever made rawvideo muxer disable audio!! with this patch, audio is processed but simply thrown away by the muxer. various 'error' conditions in rawvideo muxer are removed to make it work. feel free to re-add them if they can be done without breaking anything, but do not use printf !!!! btw old behavior can be obtained by manually specifying -nosound. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16806 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7cb2c21193
commit
3892465935
@ -21,14 +21,6 @@
|
||||
static muxer_stream_t* rawvideofile_new_stream(muxer_t *muxer,int type){
|
||||
muxer_stream_t* s;
|
||||
if (!muxer) return NULL;
|
||||
if (type == MUXER_TYPE_AUDIO) {
|
||||
printf("Rawvideo muxer does not support audio !\n");
|
||||
return NULL;
|
||||
}
|
||||
if(muxer->avih.dwStreams>=1){
|
||||
printf("Too many streams! Rawvideo muxer supports only one video stream !\n");
|
||||
return NULL;
|
||||
}
|
||||
s=malloc(sizeof(muxer_stream_t));
|
||||
memset(s,0,sizeof(muxer_stream_t));
|
||||
if(!s) return NULL; // no mem!?
|
||||
@ -44,9 +36,6 @@ static muxer_stream_t* rawvideofile_new_stream(muxer_t *muxer,int type){
|
||||
s->h.fccType=streamtypeVIDEO;
|
||||
if(!muxer->def_v) muxer->def_v=s;
|
||||
break;
|
||||
default:
|
||||
printf("WarninG! unknown stream type: %d\n",type);
|
||||
return NULL;
|
||||
}
|
||||
muxer->avih.dwStreams++;
|
||||
return s;
|
||||
@ -65,6 +54,7 @@ static void rawvideofile_write_chunk(muxer_stream_t *s,size_t len,unsigned int f
|
||||
muxer_t *muxer=s->muxer;
|
||||
|
||||
// write out the chunk:
|
||||
if (s->type == MUXER_TYPE_VIDEO)
|
||||
write_rawvideo_chunk(muxer->file,len,s->buffer); /* unsigned char */
|
||||
|
||||
// alter counters:
|
||||
|
@ -580,10 +580,6 @@ sh_video=d_video->sh;
|
||||
mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_ForcingInputFPS, sh_video->fps);
|
||||
}
|
||||
|
||||
if(sh_audio && out_file_format==MUXER_TYPE_RAWVIDEO){
|
||||
mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_RawvideoDoesNotSupportAudio);
|
||||
sh_audio=NULL;
|
||||
}
|
||||
if(sh_audio && out_audio_codec<0){
|
||||
if(audio_id==-2)
|
||||
mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_DemuxerDoesntSupportNosound);
|
||||
@ -1302,6 +1298,8 @@ default:
|
||||
badframes++;
|
||||
if(skip_flag<=0){
|
||||
// unwanted skipping of a frame, what to do?
|
||||
v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate;
|
||||
#if 0
|
||||
if(skip_limit==0){
|
||||
// skipping not allowed -> write empty frame:
|
||||
if (!encode_duplicates || !sh_video->vfilter || ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_DUPLICATE_FRAME, 0) != CONTROL_TRUE)
|
||||
@ -1310,6 +1308,7 @@ default:
|
||||
// skipping allowed -> skip it and distriubute timer error:
|
||||
v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user