[MPlayer-dev-eng] [PATCH]: Fallback to null video codec

Filip Kalinski filon at pld.org.pl
Fri Jan 10 13:40:46 CET 2003


Hi,

Some time ago I was complaining about crashing of mplayer when:

> 
> And when run mplayer <file> -vo null -vc none sh_video is null...
                                           ^^^^ 

Of course I wanted to use -vc null, vc none doesn't exit :-), and this
was the reason of crash (RTFM rulez!). With -vc null it works, as it should.

Anyway, I think, that in case of wrong codecs list given by user (such
as -vc none or -vc foo or somehing even more stupid) mplayer should
fallback to -vc null to not make mpayer crashing (sh_video is then
properly initialized).

This is a patch for it.

--- main.orig/libmpcodecs/dec_video.c	2002-11-11 18:28:21.000000000 +0100
+++ main.dev/libmpcodecs/dec_video.c	2003-01-10 13:25:38.000000000 +0100
@@ -284,6 +284,8 @@
 if(!sh_video->inited){
     mp_msg(MSGT_DECVIDEO,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
     mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
+    // fall back to null when codec is not found
+    init_video(sh_video,"null",NULL,-1);
     return 0; // failed
 }
 
-- 
Filip Kalinski <filon at pld.org.pl>


More information about the MPlayer-dev-eng mailing list