Skip to content

Commit

Permalink
Make sure metadata.map does not mutate existing metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 3, 2023
1 parent 80f1a91 commit 93f305b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Fixed:
number of channels.
- Improved support for unitary minus, fix runtime call of optional
methods (#3498)
- Fixed `map.metadata` mutating existing metadata.
- Fixed reloading loop in playlists with invalid files (#3479)
- Fixed main HLS playlist codecs when using `mpegts` (#3483)
- Fixed pop/clicks in crossfade and source with caching (#3318)
Expand Down
4 changes: 3 additions & 1 deletion src/core/operators/map_metadata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class map_metadata source rewrite_f insert_missing update strip =
List.iter
(fun (t, m) ->
if t >= p then (
let m = Hashtbl.copy m in
self#rewrite m;
if strip && Hashtbl.length m = 0 then Frame.free_metadata buf t))
if strip && Hashtbl.length m = 0 then Frame.free_metadata buf t
else Frame.set_metadata buf t m))
(Frame.get_all_metadata buf)
end

Expand Down

0 comments on commit 93f305b

Please sign in to comment.