After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 379298 - [avimux] allow multiple audio streams
[avimux] allow multiple audio streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.4
Other Linux
: Normal enhancement
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-25 22:46 UTC by Mark Nauwelaerts
Modified: 2007-01-14 17:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with modifications (57.86 KB, patch)
2006-11-25 22:53 UTC, Mark Nauwelaerts
none Details | Review
Revised patch with modifications (58.65 KB, patch)
2007-01-12 22:08 UTC, Mark Nauwelaerts
committed Details | Review
Patch to fix memory leak (993 bytes, patch)
2007-01-13 22:52 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2006-11-25 22:46:20 UTC
Some enhancements and fixes to avimux:
* a bit of code restructuring/clean-up
* in particular, allow for more (than 2) streams: restricted to 1 video; multiple audio (e.g. for DVD transcoding, if so desired)
* small fix in AVIX header
* don't boast vorbis in caps
(since setcaps won't accept them anyway --e.g. no samplerate or channels-- and vorbis in AVI is a bit ??, at least for other players ...)
Comment 1 Mark Nauwelaerts 2006-11-25 22:53:32 UTC
Created attachment 77144 [details] [review]
Patch with modifications

Patch implementing changes given above. Note that:
* unit test (check) has also slightly changed, because ...
* reaction to (un)linking --e.g. excluding from collectpads-- has been removed; this is more aligned with other muxers and according to discussion in bug #374682
Comment 2 Mark Nauwelaerts 2007-01-12 22:08:58 UTC
Created attachment 80148 [details] [review]
Revised patch with modifications

In case of releasing a request(ed) pad before streaming actually starts, the original patch produces incorrect stream tags in the resulting AVI file.  This patch fixes this, all else is the same.
Comment 3 Tim-Philipp Müller 2007-01-13 16:12:53 UTC
Was going to commit this, but 'make elements/avimux.valgrind' shows the following leak:

Running suite(s): avimux==9571== 
==9571== 646 (8 direct, 638 indirect) bytes in 1 blocks are definitely lost in loss record 1,861 of 1,911
==9571==    at 0x4022396: malloc (vg_replace_malloc.c:149)
==9571==    by 0x426ECE5: g_malloc (gmem.c:131)
==9571==    by 0x427E747: g_slice_alloc (gslice.c:777)
==9571==    by 0x427F89A: g_slist_append (gslist.c:69)
==9571==    by 0x465BC3E: gst_avi_mux_reset (gstavimux.c:341)
==9571==    by 0x465DA4D: gst_avi_mux_change_state (gstavimux.c:1716)
==9571==    by 0x405BA99: gst_element_change_state (gstelement.c:2275)
==9571==    by 0x405BB81: gst_element_change_state (gstelement.c:2308)
==9571==    by 0x405E922: gst_element_set_state_func (gstelement.c:2236)
==9571==    by 0x405AC82: gst_element_set_state (gstelement.c:2144)
==9571==    by 0x80492F6: cleanup_avimux (avimux.c:135)
==9571==    by 0x8049D41: check_avimux_pad (avimux.c:223)
==9571==    by 0x8049E6E: test_video_pad (avimux.c:231)
==9571==    by 0x402C35D: srunner_run_all (in /home/tpm/uninstalled/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.10.0)
==9571==    by 0x8049128: main (avimux.c:268)
==9572== 
==9572== 630 (8 direct, 622 indirect) bytes in 1 blocks are definitely lost in loss record 1,861 of 1,912
==9572==    at 0x4022396: malloc (vg_replace_malloc.c:149)
==9572==    by 0x426ECE5: g_malloc (gmem.c:131)
==9572==    by 0x427E747: g_slice_alloc (gslice.c:777)
==9572==    by 0x427F89A: g_slist_append (gslist.c:69)
==9572==    by 0x465BC3E: gst_avi_mux_reset (gstavimux.c:341)
==9572==    by 0x465DA4D: gst_avi_mux_change_state (gstavimux.c:1716)
==9572==    by 0x405BA99: gst_element_change_state (gstelement.c:2275)
==9572==    by 0x405BB81: gst_element_change_state (gstelement.c:2308)
==9572==    by 0x405E922: gst_element_set_state_func (gstelement.c:2236)
==9572==    by 0x405AC82: gst_element_set_state (gstelement.c:2144)
==9572==    by 0x80492F6: cleanup_avimux (avimux.c:135)
==9572==    by 0x8049D41: check_avimux_pad (avimux.c:223)
==9572==    by 0x8049DCE: test_audio_pad (avimux.c:239)
==9572==    by 0x402C35D: srunner_run_all (in /home/tpm/uninstalled/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.10.0)
==9572==    by 0x8049128: main (avimux.c:268)

That should probably be fixed before committing (follow-up patch is fine for me).

Comment 4 Mark Nauwelaerts 2007-01-13 22:52:06 UTC
Created attachment 80209 [details] [review]
Patch to fix memory leak

Fix mem leak in finalization
(silly mistake; including mis-remembering having run this check for another element :-( )
Comment 5 Tim-Philipp Müller 2007-01-14 17:56:58 UTC
Thanks! Committed:

  2007-01-14  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Mark Nauwelaerts <manauw at skynet be>

        * gst/avi/gstavimux.c: (gst_avi_mux_finalize),
        (gst_avi_mux_pad_reset), (gst_avi_mux_reset), (gst_avi_mux_init),
        (gst_avi_mux_vidsink_set_caps), (gst_avi_mux_audsink_set_caps),
        (gst_avi_mux_request_new_pad), (gst_avi_mux_release_pad),
        (gst_avi_mux_riff_get_avi_header),
        (gst_avi_mux_riff_get_avix_header), (gst_avi_mux_riff_get_header),
        (gst_avi_mux_write_avix_index), (gst_avi_mux_add_index),
        (gst_avi_mux_bigfile), (gst_avi_mux_start_file),
        (gst_avi_mux_stop_file), (gst_avi_mux_handle_event),
        (gst_avi_mux_do_buffer), (gst_avi_mux_do_one_buffer),
        (gst_avi_mux_change_state):
        * gst/avi/gstavimux.h:
        * tests/check/elements/avimux.c: (teardown_src_pad):
          Add support for more than one audio stream; write better AVIX
          header; refactor code a bit; don't announce vorbis caps on our audio
          sink pads since we don't support it anyway. Closes #379298.