[ 
http://dev.sourcefabric.org/browse/LS-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15626#action_15626
 ] 

Romeo commented on LS-503:
--------------------------

I have an idea how to do that. 

If you can check in "configure.ml" if encoding name is available, then you 
simply use provided one if it is, or the default one (say, utf-8) if not. 

if you cannot check the availability, then you can use try-catch block and make 
test metadata recoding before real encoding. if Exception is rised then use 
default encoding.

i think it's better to do that in "configure.ml"

you already try to verify if encoding is set by 

let in_enc =                                                                    
                                                                                
                                              
    match in_enc with                                                           
                                                                                
                                                
      | Some e -> enc_of_name e                                                 
                                                                                
                                                
      | None -> get_encoding ()                                                 
                                                                                
                                                
  in                                                                            
                                                                                
                                                
  let out_enc =                                                                 
                                                                                
                                                
    match out_enc with                                                          
                                                                                
                                                
      | Some e -> enc_of_name e                                                 
                                                                                
                                                
      | None -> C.utf8  

but if it is not supported by camomile you got an exception that is not catched 
in

try C.recode_string ~in_enc ~out_enc s with e ->                                
                                                                                
                                            
      let in_enc =                                                              
                                                                                
                                                
        if in_enc == get_encoding () then                                       
                                                                                
                                                
          Printf.sprintf "auto(%s)" (String.concat "," conf_encoding#get)       
                                                                                
                                                
        else                                                                    
                                                                                
                                                
          C.name_of in_enc                                                      
                                                                                
                                                
      in                                                                        
                                                                                
                                                
      camolog#f 3 "Failed to convert %S from %s to %s (%s)!"                    
                                                                                
                                                
        s in_enc (C.name_of out_enc) (Printexc.to_string e) ;                   
                                                                                
                                                
      s

If i know OCaml i'll fix it myself, but i just can understand only the main 
idea of what's written here.

by the way, i didn't find the way to set the "out_enc" variable. It's always 
Latin-bla-bla-bla...

> Liquidsoap locks-up on uncaught exception
> -----------------------------------------
>
>                 Key: LS-503
>                 URL: http://dev.sourcefabric.org/browse/LS-503
>             Project: Liquidsoap
>          Issue Type: Bug
>          Components: Liquidsoap
>    Affects Versions: 1.0 beta
>         Environment: Ubuntu Linux x64
>            Reporter: Romeo
>            Assignee: Romain Beauxis
>            Priority: Blocker
>
> When mistyping the encoding in set("tag.encodings",["UTF-8","CP-1251"]) the 
> liquidsoap will lock-up when trying to fetch the stream. It doesn't respond 
> neither to stop daemon, nor to the kill signal. only -KILL will help to end 
> this. log and script are attached.
> Stream script is:
> ################### [Definitions] ###################
> streamTitle = "RadioVkontakte.ru | ICQ:6979990"
> streamDescr = "RadioVkontakte.ru"
> streamGenre = "Electronic"
> streamUrl = ""
> streamICQ = "6979990"
> masterHost = "radiovkontakte.ru"
> masterPort = 9000
> masterMount = "/rvk.ogg"
> testMount = "/test.ogg"
> masterBitrate = 72
> masterPasswd = "***"
> masterUrl = "http://"; ^ masterHost ^ ":#{masterPort}" ^ masterMount
> livePasswd = "***"
> liveMount = "live.ogg"
> playlistPasswd = "***"
> playlistMount = "playlist.ogg"
> shoutcastPasswd = "***"
> shoutcastHost = "radiovkontakte.ru"
> basePath = "/home/radio/"
> logLevel = 5
> set("init.daemon.pidfile.path","/var/run/liquidsoap/<script>.pid")
> set("init.daemon.pidfile",true)
> set("init.daemon",true)
> set("init.trace",true)
> set("log.level",logLevel)
> set("log.file.path", basePath ^ "log/<script>.log")
> set("server.telnet.reverse_dns", false)
> set("harbor.reverse_dns", false)
> set("tag.encodings",["UTF-8","CP-1251"])
> def stream_source(host, port, mount, pass, proto, format, source) = 
>     output.icecast(
>       id="#{host}_#{port}_#{mount}",
>         restart=true,
>         mount=mount,
>         host=host,
>         port=port,
>         password=pass,
>         genre=streamGenre,
>         url=streamUrl,
>         description=streamDescr,
>         name=streamTitle,
>       protocol=proto,
>       format,
>         source
>     )
> end
> ################### [Input] ###################
> input = input.http(
>     masterUrl,
>     new_track_on_metadata = false
> );
> input = mksafe(input)
> ################### [Output] ###################
> stream_source(
>     masterHost,
>     masterPort,
>     "aac",
>     masterPasswd,
>     "http",
>     %aacplus(bitrate=48),
>     input
> )
> The log:
> 2011/04/04 19:23:43 >>> LOG START
> 2011/04/04 19:23:43 [protocols.external:3] Didn't find "ufetch".
> 2011/04/04 19:23:43 [protocols.external:3] Found "/usr/bin/wget".
> 2011/04/04 19:23:43 [main:3] Liquidsoap 1.0.0-beta+svn 
> (trunk/liquidsoap@rev8237)
> 2011/04/04 19:23:43 [main:3] Using: pcre=6.0.1 dtools=0.2.2 duppy=0.4.0
> 0.4.0 duppy.syntax=0.4.0
> 0.4.0 cry=0.1.6 mm=0.1.0 xmlplaylist=0.1.2 lastfm=0.3.0 ogg=0.4.1 
> vorbis=0.5.1 mad=0.4.0 flac=0.1.0 flac.ogg=0.1.0 lame=0.2.4 aacplus=0.2.0 
> theora=0.2.0 samplerate=0.1.1 taglib=0.1.4 camomile=0.7.1 faad=0.2.0 
> faac=0.1.2 soundtouch=0.1.6 ladspa=0.1.2
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [main:2] DISCLAIMER: This version of Liquidsoap has been
> 2011/04/04 19:23:43 [main:2] compiled from a snapshot of the development code.
> 2011/04/04 19:23:43 [main:2] As such, it should not be used in production
> 2011/04/04 19:23:43 [main:2] unless you know what you are doing!
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [main:2] We are, however, very interested in any feedback
> 2011/04/04 19:23:43 [main:2] about our development code and committed to fix
> 2011/04/04 19:23:43 [main:2] issues as soon as possible.
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [main:2] If you are interested in collaborating to
> 2011/04/04 19:23:43 [main:2] the development of Liquidsoap, feel free to
> 2011/04/04 19:23:43 [main:2] drop us a mail at <[email protected]>
> 2011/04/04 19:23:43 [main:2] or to join the #savonet IRC channel on Freenode.
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [main:2] Please send any bug report or feature request
> 2011/04/04 19:23:43 [main:2] using our trac <http://savonet.rastageeks.org>.
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [main:2] We hope you enjoy this snapshot build of 
> Liquidsoap!
> 2011/04/04 19:23:43 [main:2] 
> 2011/04/04 19:23:43 [lang:3] Did not find flac binary: flac decoder disabled.
> 2011/04/04 19:23:43 [lang:3] Did not find metaflac binary: flac metadata 
> resolver disabled.
> 2011/04/04 19:23:43 [lang:3] Did not find faad binary: faad decoder disabled.
> 2011/04/04 19:23:43 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
> 2011/04/04 19:23:43 [frame:3] Frame size must be a multiple of 1764 ticks = 
> 1764 audio samples = 1 video samples.
> 2011/04/04 19:23:43 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio 
> samples = 1764 ticks.
> 2011/04/04 19:23:43 [frame:3] Frames last 0.04s = 1764 audio samples = 1 
> video samples = 1764 ticks.
> 2011/04/04 19:23:43 [video.converter:4] Couldn't find preferred video 
> converter: gavl.
> 2011/04/04 19:23:43 [audio.converter:4] Using preferred samplerate converter: 
> libsamplerate.
> 2011/04/04 19:23:43 [threads:3] Created thread "generic queue #1".
> 2011/04/04 19:23:43 [threads:3] Created thread "non-blocking queue #1".
> 2011/04/04 19:23:43 [clock:4] Currently 1 clocks allocated.
> 2011/04/04 19:23:43 [clock.wallclock_main:4] Starting 1 sources...
> 2011/04/04 19:23:43 [source:4] Source radiovkontakte(dot)ru_8100_rvkMid gets 
> up.
> 2011/04/04 19:23:43 [source:4] Source mksafe gets up.
> 2011/04/04 19:23:43 [source:4] Source src_4565 gets up.
> 2011/04/04 19:23:43 [threads:3] Created thread "http polling" (1 total).
> 2011/04/04 19:23:43 [src_4565:4] Activations changed: static=[], 
> dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
> 2011/04/04 19:23:43 [source:4] Source safe_blank gets up.
> 2011/04/04 19:23:43 [safe_blank:4] Content kind is {audio=2;video=0;midi=0}.
> 2011/04/04 19:23:43 [safe_blank:4] Activations changed: static=[], 
> dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
> 2011/04/04 19:23:43 [mksafe:4] Activations changed: 
> static=[radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid], 
> dynamic=[].
> 2011/04/04 19:23:43 [stdout:3] init(0):init-start                         
> @stop-atom
> 2011/04/04 19:23:43 [src_4565:4] Connecting to 
> <http://radiovkontakte.ru:9000/rvk.ogg>...
> 2011/04/04 19:23:43 [radiovkontakte(dot)ru_8100_rvkMid:4] Activations 
> changed: static=[radiovkontakte(dot)ru_8100_rvkMid], dynamic=[].
> 2011/04/04 19:23:43 [stdout:3] init(0):init-start                         
> @start-triggers
> 2011/04/04 19:23:43 [radiovkontakte(dot)ru_8100_rvkMid:4] Enabling caching 
> mode: active source.
> 2011/04/04 19:23:44 [radiovkontakte(dot)ru_8100_rvkMid:3] Connecting mount 
> rvkMid for [email protected]...
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop-triggers
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @return
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @called
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @start
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @start-depends
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop-depends
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @start-atom
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop-atom
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @start-triggers
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop-triggers
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @return
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop-triggers
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @stop
> 2011/04/04 19:23:44 [stdout:3] init(0):init-start                         
> @return
> 2011/04/04 19:23:44 [radiovkontakte(dot)ru_8100_rvkMid:3] Connection setup 
> was successful.
> 2011/04/04 19:23:44 [threads:3] Created thread "wallclock_main" (2 total).
> 2011/04/04 19:23:44 [clock:4] Main phase starts.
> 2011/04/04 19:23:44 [clock.wallclock_main:3] Streaming loop starts, 
> synchronized with wallclock.
> 2011/04/04 19:23:44 [mksafe:3] Switch to safe_blank.
> 2011/04/04 19:23:44 [safe_blank:4] Activations changed: 
> static=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid],
>  
> dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
> 2011/04/04 19:23:44 [src_4565:4] Could not get file: File Not Found
> 2011/04/04 19:23:44 [src_4565:4] Connection failed: Http_source.Internal
> 2011/04/04 19:23:46 [src_4565:4] Connecting to 
> <http://radiovkontakte.ru:9000/rvk.ogg>...
> 2011/04/04 19:23:46 [src_4565:4] Trying playlist parser for mime 
> application/ogg
> 2011/04/04 19:23:46 [src_4565:4] Content-type "application/ogg".
> 2011/04/04 19:23:46 [decoder:4] Trying method "MP3/LIBMAD" for 
> "application/ogg"...
> 2011/04/04 19:23:46 [decoder:4] Trying method "OGG" for "application/ogg"...
> 2011/04/04 19:23:46 [decoder:3] Method "OGG" accepted "application/ogg".
> 2011/04/04 19:23:46 [src_4565:3] Decoding...
> 2011/04/04 19:23:46 [ogg.demuxer:5] Found a ogg logical stream, serial: 
> 327b23c6
> 2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/flac format
> 2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/theora format
> 2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/vorbis format
> 2011/04/04 19:23:46 [ogg.demuxer:5] ogg/vorbis format detected for stream 
> 327b23c6
> 2011/04/04 19:23:47 [mksafe:3] Switch to src_4565 with transition.
> 2011/04/04 19:23:47 [safe_blank:4] Activations changed: static=[], 
> dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
> 2011/04/04 19:23:47 [src_4565:4] Activations changed: 
> static=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid],
>  
> dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
> 2011/04/04 19:23:47 [threads:1] Thread "wallclock_main" failed: Unknown 
> encoding "CP-1251"!!
> 2011/04/04 19:23:47 [main:3] Shutdown started!
> 2011/04/04 19:23:47 [main:3] Waiting for threads to terminate...
> 2011/04/04 19:23:47 [stderr:3] Thread 5 killed on uncaught exception 
> Failure("Unknown encoding "CP-1251"!")
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @called
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @start
> 2011/04/04 19:23:47 [stderr:3] Raised at file "pervasives.ml", line 22, 
> characters 22-33
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @start-depends
> 2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 57, 
> characters 20-23
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @called
> 2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 57, 
> characters 32-39
> 2011/04/04 19:23:47 [stderr:3] Called from file "array.ml", line 122, 
> characters 21-40
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @start
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @start-depends
> 2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 69, 
> characters 12-15
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @stop-depends
> 2011/04/04 19:23:47 [stdout:3] init(0):init-stop                          
> @start-atom
> 2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.01s.
> 2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.02s.
> <...>
> 2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:32:33 [src_4565:2] Feeding stopped: Ogg.Not_enough_data.
> 2011/04/04 19:32:35 [src_4565:4] Connecting to 
> <http://radiovkontakte.ru:9000/rvk.ogg>...
> 2011/04/04 19:32:35 [src_4565:4] Could not get file: File Not Found
> 2011/04/04 19:32:35 [src_4565:4] Connection failed: Http_source.Internal
> 2011/04/04 19:32:37 [src_4565:4] Connecting to 
> <http://radiovkontakte.ru:9000/rvk.ogg>...
> 2011/04/04 19:32:38 [src_4565:4] Trying playlist parser for mime 
> application/ogg
> 2011/04/04 19:32:38 [src_4565:4] Content-type "application/ogg".
> 2011/04/04 19:32:38 [decoder:4] Trying method "MP3/LIBMAD" for 
> "application/ogg"...
> 2011/04/04 19:32:38 [decoder:4] Trying method "OGG" for "application/ogg"...
> 2011/04/04 19:32:38 [decoder:3] Method "OGG" accepted "application/ogg".
> 2011/04/04 19:32:38 [src_4565:3] Decoding...
> 2011/04/04 19:32:38 [ogg.demuxer:5] Found a ogg logical stream, serial: 
> 6b8b4567
> 2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/flac format
> 2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/theora format
> 2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/vorbis format
> 2011/04/04 19:32:38 [ogg.demuxer:5] ogg/vorbis format detected for stream 
> 6b8b4567
> 2011/04/04 19:32:38 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:32:38 [src_4565:3] Buffer overrun: Dropping 0.02s.
> <...>
> 2011/04/04 19:34:37 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:34:37 [src_4565:3] Buffer overrun: Dropping 0.02s.
> 2011/04/04 19:37:28 >>> LOG START

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://dev.sourcefabric.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Savonet-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-devl

Répondre à