Bugzilla – Attachment 48052 Details for
Bug 113937
GStreamer/cdparanoia gst_pad_query invalid data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
Source to testcase demonstrating bug
gst-pad-bug.c (text/plain), 1.69 KB, created by
Aaron Bockover
on 2005-08-29 17:56:13 UTC
(
hide
)
Description:
Source to testcase demonstrating bug
Filename:
MIME Type:
Creator:
Aaron Bockover
Created:
2005-08-29 17:56:13 UTC
Size:
1.69 KB
patch
obsolete
>/* gst-pad-bug.c > >$ gcc -o gst-pad-bug `pkg-config --libs --cflags glib-2.0 gstreamer-0.8` \ > gst-pad-bug.c > >gst_pad_query incorrectly returns 0 for the total number of sectors. I also >would venture to guess that gst_pad_convert() fails for converting a >track index (track_format) to an end sector (sector format), but am not >sure if that is because the query fails, or if because all sector-related >code in the plugin or cdparanoia is broken. > >Insert an audio CD in /dev/hdc (or change DEVICE below), wait for it to >spin up and settle down, and then run this program. The number of tracks >(n_tracks) on the CD should be valid, but total_sectors will be 0. > >Aaron Bockover (abockover novell com) > >*/ > >#include <stdio.h> >#include <stdlib.h> >#include <glib.h> >#include <gst/gst.h> > >#define TOC_OFFSET 150 >#define DEVICE "/dev/hdc" > >int main() >{ > GstElement *source; > GstPad *source_pad; > GstFormat track_format, sector_format; > GstFormat time_format = GST_FORMAT_TIME; > gint64 start_sector, end_sector, n_tracks, total_sectors; > > gst_init(NULL, NULL); > > source = gst_element_factory_make("cdparanoia", "cdparanoia"); > g_object_set(G_OBJECT(source), "device", DEVICE, NULL); > > track_format = gst_format_get_by_nick("track"); > sector_format = gst_format_get_by_nick("sector"); > source_pad = gst_element_get_pad(source, "src"); > > gst_element_set_state(source, GST_STATE_PAUSED); > > gst_pad_query(source_pad, GST_QUERY_TOTAL, &track_format, &n_tracks); > gst_pad_query(source_pad, GST_QUERY_TOTAL, §or_format, &total_sectors); > > gst_element_set_state(source, GST_STATE_NULL); > gst_object_unref(GST_OBJECT(source)); > > g_printf("n_tracks = %lld\n", n_tracks); > g_printf("total_sectors = %lld\n", total_sectors); > > exit(0); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 113937
: 48052 |
48083
|
48256