GNOME Bugzilla – Bug 697239
[mpegtsmux] Let prog-map define the program number
Last modified: 2013-08-21 11:05:28 UTC
In the current implementation, the prog-map property of mpegtsmux is used to group PID's together. There is no way to actually set the program number used in the TS stream. With the attached patch, the muxer will use the values set in the prog-map as the actual program number. This will enable you to make a TS stream with i.e. 2 programs with program number 10 and 20. If a prog-map is not set, or the value is set to 0, the muxer behaves as before, assigning programs in an incremental order. With the patches discussed in https://bugzilla.gnome.org/show_bug.cgi?id=690934 that fixes the program property of tsdemux, this will give you more control of the programs in the TS stream.
Created attachment 240573 [details] [review] Patch to let prog-map set program number
Any comments on the proposed patch? It still applies on master.
Review of attachment 240573 [details] [review]: apart from the comments, looks good to me. ::: gst/mpegtsmux/tsmux/tsmux.c @@ +469,3 @@ +static gint +tsmux_program_compare (gconstpointer * a, gconstpointer * b) You could just move this before where it's being used and avoid the forward declaration. @@ +474,3 @@ + gint *needle = (gint *) b; + + return (program->pgm_number - *needle); Just make the arguments of this compare function be (TsMuxProgram *program, gint *needle) and remove the temporary variables. You'll then need to cast this function to (GCompareFunc) when you provide it to g_list_find_custom.
Created attachment 252520 [details] [review] [PATCH v2] mpegtsmux: Set the program number from prog-map Updated patch according to the comments by Edward Hervey
commit e4a0c4d5092639e01fa8c9db4f8225b27c1d5c2e Author: Jesper Larsen <jesper.larsen@ixonos.com> Date: Sun Mar 10 17:02:18 2013 +0100 mpegtsmux: Set the program number from prog-map The prog-map property of mpegtsmux only allows you to group pids together in a program. The program number set in the PAT/PMT tables cannot be set explicitly. This patch will set the program number according to the prog-map. If a program id of 0 is given, the first vacant program number starting from 1 will be used. https://bugzilla.gnome.org/show_bug.cgi?id=697239