GNOME Bugzilla – Bug 464419
oggmux needs to handle seek-event
Last modified: 2008-07-25 15:59:22 UTC
oggmux currently rejects seek-events. If I put adder-alike code in there the EOS and SEGMEN_DONE behaviour works with oggmux, but generated files are illegal (cause crash in oggdemux when playing).
+ Trace 153519
> ogginfo test.ogg Processing file "test.ogg"... Warning: Invalid header page, no packet found Warning: Invalid header page in stream 1, contains multiple packets New logical stream (#1, serial: 4584cc56): type invalid Warning: stream start flag not set on stream 1 Warning: sequence number gap in stream 1. Got page 2 when expecting page 0. Indicates missing data. Logical stream 1 ended
When I just comment out the special seek handling in gst_ogg_mux_handle_src_event() (so that is uses gst_pad_event_default(), then it handles EOS, but the file is broken (see comment #1) this is patched and 2nd example is default (cvs version). whats the problem here. Why does the code triggered on eos create broken files? > GST_DEBUG="*:2,vorbisenc:3,oggmux:4" ./bt-cmd --command=encode --input-file=../share/buzztard/songs/melo1.xml --output-file=$HOME/temp/melo1.ogg 0:00:00.577449000 6392 0x804fe08 DEBUG oggmux gstoggmux.c:411:gst_ogg_mux_request_new_pad:<oggmux> Creating new pad for serial 946497966 0:00:00.578297000 6392 0x804fe08 DEBUG oggmux gstoggmux.c:371:gst_ogg_mux_sinkconnect:<oggmux> sinkconnect triggered on sink_946497966 0:00:01.043822000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:01.043954000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:01.044026000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:01.044088000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:01.044154000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:01.044214000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:01.045499000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:817:gst_ogg_mux_queue_pads:<oggmux> got data buffer in control state, switching to data mode 0:00:01.045565000 6392 0x81a08c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:01.186734000 6392 0x8259fd8 WARN pipeline gstpipeline.c:491:gst_pipeline_change_state:<song> failed to query pipeline latency 00:07.25 00:00:02.140397000 6392 0x819acc8 DEBUG oggmux gstoggmux.c:823:gst_ogg_mux_queue_pads:<oggmux:sink_946497966> EOS on pad 0:00:02.140522000 6392 0x819acc8 DEBUG oggmux gstoggmux.c:1399:gst_ogg_mux_process_best_pad:<oggmux:sink_946497966> swapping in EOS packet 0:00:02.140603000 6392 0x819acc8 DEBUG oggmux gstoggmux.c:823:gst_ogg_mux_queue_pads:<oggmux:sink_946497966> EOS on pad 0:00:02.140667000 6392 0x819acc8 DEBUG oggmux gstoggmux.c:1578:gst_ogg_mux_collected:<oggmux> Pushing EOS 00:08.000 ensonic@hoshi:~/buzztard/bin> GST_DEBUG="*:2,vorbisenc:3,oggmux:4" ./bt-cmd --command=encode --input-file=../share/buzztard/songs/melo1.xml --output-file=$HOME/temp/melo1.ogg 0:00:00.389443000 8135 0x804fe08 DEBUG oggmux gstoggmux.c:411:gst_ogg_mux_request_new_pad:<oggmux> Creating new pad for serial 1264230769 0:00:00.389734000 8135 0x804fe08 DEBUG oggmux gstoggmux.c:371:gst_ogg_mux_sinkconnect:<oggmux> sinkconnect triggered on sink_1264230769 0:00:00.935608000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:00.935749000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:00.935828000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:00.935896000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:00.935968000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:811:gst_ogg_mux_queue_pads:<oggmux> got incaps buffer in control state, ignoring 0:00:00.936034000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:00.937328000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:817:gst_ogg_mux_queue_pads:<oggmux> got data buffer in control state, switching to data mode 0:00:00.937401000 8135 0x81a05c0 DEBUG oggmux gstoggmux.c:1551:gst_ogg_mux_collected:<oggmux> No buffer available on best pad 0:00:00.939392000 8135 0x804fe08 WARN bt-core song.c:448:on_song_state_changed: bin failed to handle seek event 0:00:00.939665000 8135 0x804fe08 WARN pipeline gstpipeline.c:491:gst_pipeline_change_state:<song> failed to query pipeline latency 00:08.125
To make it crystal clear. I don't want to seek. My app is sending the seek to tell about the playback-segment. I send that to the pipeline and it will send it to elements staring from the sinks. If oggmux reject it, the sources never get a newsegment and the pipeline will never stop.
The docs for gst_event_new_eos() says: Create a new EOS event. The eos event can only travel downstream synchronized with the buffer flow. Filesink cannot do it as it works based on bytes and not time. So imho it has to be the muxer. After some look at oggmux and avimux, they only sent eos, when their pads are done. How should that work when one does e.g. a timed live-capture?
I now set num-buffer on all my source elements so that thay send EOS.