Changeset 7166
- Timestamp:
- 02/12/10 19:09:24 (7 months ago)
- Location:
- trunk/liquidsoap/src
- Files:
-
- 4 modified
-
lang/lang.ml (modified) (1 diff)
-
request.ml (modified) (5 diffs)
-
request.mli (modified) (1 diff)
-
sources/request_source.ml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/liquidsoap/src/lang/lang.ml
r7086 r7166 216 216 217 217 let request r = 218 mk (request_t (kind_type_of_frame_kind (Request.kind r))) (Request r) 218 let kind = 219 match Request.kind r with 220 | Some k -> k 221 | None -> let z = Frame.Zero in {Frame.audio=z;video=z;midi=z} 222 in 223 mk (request_t (kind_type_of_frame_kind kind)) (Request r) 219 224 220 225 let val_fun p ~ret_t f = -
trunk/liquidsoap/src/request.ml
r7110 r7166 187 187 type status = Idle | Resolving | Ready | Playing | Destroyed 188 188 189 (** Each request has a kind, telling how it might be used.190 * Non-trivial kinds are for "media requests", audio or video files.191 * For other, "raw requests", we use the following empty kind. *)192 let raw_kind =193 { Frame.194 audio = Frame.Zero ;195 video = Frame.Zero ;196 midi = Frame.Zero }197 198 189 type t = { 199 190 id : int ; 200 191 initial_uri : string ; 201 kind : Frame.content_kind ;192 kind : Frame.content_kind option ; (* No kind for raw requests *) 202 193 persistent : bool ; 203 194 … … 338 329 | No_indicator -> () 339 330 in 340 if t.kind <> raw_kind then check_decodable t.kind331 match t.kind with None -> () | Some k -> check_decodable k 341 332 342 333 let push_indicators t l = … … 356 347 t.indicators <> [] && 357 348 Sys.file_exists (peek_indicator t).string && 358 ( t.decoder <> None || t.kind = raw_kind)349 ( t.decoder <> None || t.kind = None ) 359 350 360 351 (** [get_filename request] returns … … 414 405 | None -> () 415 406 end ; 416 if t.kind <> raw_kind then 417 replace "kind" (Frame.string_of_content_kind t.kind) ; 407 begin match t.kind with 408 | None -> () 409 | Some k -> 410 replace "kind" (Frame.string_of_content_kind k) 411 end ; 418 412 replace "status" 419 413 (match t.status with … … 486 480 t 487 481 488 let create_raw = create ~kind:raw_kind 482 let create_raw = create ~kind:None 483 let create ~kind = create ~kind:(Some kind) 489 484 490 485 let on_air t = -
trunk/liquidsoap/src/request.mli
r7110 r7166 52 52 t 53 53 54 val kind : t -> Frame.content_kind 54 (** Return the kind of a media request, None for raw requests. *) 55 val kind : t -> Frame.content_kind option 55 56 56 57 (** Destroying of a requests causes its file to be deleted if it's a temporary -
trunk/liquidsoap/src/sources/request_source.ml
r7120 r7166 76 76 false 77 77 | Some req when Request.is_ready req -> 78 assert (Frame.kind_sub_kind (Request.kind req) kind) ; 78 assert (Frame.kind_sub_kind 79 (Utils.get_some (Request.kind req)) 80 kind) ; 79 81 (* [Request.is_ready] ensures that we can get a filename from 80 82 * the request, and it can be decoded. *)
