Skip to content

Commit

Permalink
Add override in icecast utils to disable all id3v2/xing additional
Browse files Browse the repository at this point in the history
frames when encoding in mp3 with the ffmpeg encoder.
  • Loading branch information
toots committed Nov 29, 2023
1 parent 4181a8c commit 5327407
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/tools/icecast_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,18 @@ module Icecast_v (M : Icecast_t) = struct
| Encoder.AVI _ -> Some avi
| Encoder.Ogg _ -> Some ogg

let encoder_overrides = function
| Encoder.Ffmpeg { Ffmpeg_format.format = Some "mp3"; opts } as e ->
if not (Hashtbl.mem opts "id3v2_version") then
Hashtbl.add opts "id3v2_version" (`Int 0);
if not (Hashtbl.mem opts "write_xing") then
Hashtbl.add opts "write_xing" (`Int 0);
e
| e -> e

let encoder_data p =
let v = Lang.assoc "" 1 p in
let enc = Lang.to_format v in
let enc = encoder_overrides (Lang.to_format v) in
let info, format = (M.info_of_encoder enc, format_of_encoder enc) in
let encoder_factory =
try Encoder.get_factory enc
Expand Down

0 comments on commit 5327407

Please sign in to comment.