Advertisement
Guest User

Untitled

a guest
Jul 30th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.61 KB | None | 0 0
  1. importing /media/5A2813CC2813A653/Documents and Settings/Scott/Music/Better Than Ezra/Deluxe/Coyote.flac
  2. getting info..
  3.  
  4. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  5.  
  6. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  7.  
  8. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  9.  
  10. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  11.  
  12. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  13.  
  14. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed
  15.  
  16. Program received signal SIGSEGV, Segmentation fault.
  17. [Switching to Thread 0xb31fdb70 (LWP 20702)]
  18. 0x008bd641 in g_type_check_value () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
  19. (gdb) bt
  20. #0  0x008bd641 in g_type_check_value () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
  21. #1  0x00a8d938 in gst_value_init_and_copy () from /usr/lib/libgstreamer-0.10.so.0
  22. #2  0x00a71fe8 in gst_structure_copy () from /usr/lib/libgstreamer-0.10.so.0
  23. #3  0x00a72083 in ?? () from /usr/lib/libgstreamer-0.10.so.0
  24. #4  0x008bdbc2 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
  25. #5  0x00893946 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
  26. #6  0x00a7101b in ?? () from /usr/lib/libgstreamer-0.10.so.0
  27. #7  0x00a72887 in gst_structure_id_set () from /usr/lib/libgstreamer-0.10.so.0
  28. #8  0x00c0ffde in ?? () from /usr/lib/libgstpbutils-0.10.so.0
  29. #9  0x00c100f7 in ?? () from /usr/lib/libgstpbutils-0.10.so.0
  30. #10 0x00c10055 in ?? () from /usr/lib/libgstpbutils-0.10.so.0
  31. #11 0x00c1014b in ?? () from /usr/lib/libgstpbutils-0.10.so.0
  32. #12 0x00c105b7 in ?? () from /usr/lib/libgstpbutils-0.10.so.0
  33. #13 0x00c11629 in gst_discoverer_discover_uri () from /usr/lib/libgstpbutils-0.10.so.0
  34. #14 0x080915be in beat_box_file_operator_import_song ()
  35. #15 0x0808fd8d in beat_box_file_operator_get_music_files ()
  36. #16 0x0808ff21 in beat_box_file_operator_get_music_files ()
  37. #17 0x0808ff21 in beat_box_file_operator_get_music_files ()
  38. #18 0x080aec1e in beat_box_library_manager_set_music_thread_function ()
  39. #19 0x080ae561 in _beat_box_library_manager_set_music_thread_function_gthread_func ()
  40. #20 0x0094d2df in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
  41. #21 0x00e06e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
  42. #22 0x00eea73e in clone () from /lib/i386-linux-gnu/libc.so.6
  43. (gdb)
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. public Song? import_song(GLib.File file) {
  52.         Song s = new Song(file.get_path());
  53.         stdout.printf("importing %s\n", file.get_path());
  54.         DiscovererInfo info;
  55.        
  56.         try {
  57.             stdout.printf("getting info..\n");
  58.             info = disc.discover_uri(file.get_uri());
  59.             stdout.printf("info recieved\n");
  60.             if(info == null)
  61.                 return null;
  62.         }
  63.         catch(GLib.Error err) {
  64.             stdout.printf("Could not read song's metadata\n");
  65.             return null;
  66.         }
  67.         stdout.printf("import_song info fetched\n");
  68.         unowned TagList tags = info.get_tags();
  69.         stdout.printf("taglist set\n");
  70.         if(info != null && tags != null) {
  71.             try {
  72.                 string title, artist, album_artist, album, genre, comment, lyrics;
  73.                 uint track, track_count, album_number, album_count, bitrate, rating;
  74.                 double bpm;
  75.                 int64 duration;
  76.                 GLib.Date? date = new GLib.Date();
  77.                 stdout.printf("0\n");
  78.                 /* get title, artist, album artist, album, genre, comment, lyrics strings */
  79.                 if(tags.get_string(TAG_TITLE, out title))
  80.                     s.title = title;
  81.                 if(tags.get_string(TAG_ARTIST, out artist))
  82.                     s.artist = artist;
  83.                 stdout.printf("a\n");
  84.                 if(tags.get_string(TAG_ALBUM_ARTIST, out album_artist))
  85.                     s.album_artist = album_artist;
  86.                 else
  87.                     s.album_artist = s.artist;
  88.                 stdout.printf("b\n");
  89.                 if(tags.get_string(TAG_ALBUM, out album))
  90.                     s.album = album;
  91.                 if(tags.get_string(TAG_GENRE, out genre))
  92.                     s.genre = genre;
  93.                 if(tags.get_string(TAG_COMMENT, out comment))
  94.                     s.comment = comment;
  95.                 if(tags.get_string(TAG_LYRICS, out lyrics))
  96.                     s.lyrics = lyrics;
  97.                
  98.                 /* get the year */
  99.                 if(tags.get_date(TAG_DATE, out date)) {
  100.                     if(date != null)
  101.                         s.year = (int)date.get_year();
  102.                 }
  103.                 /* get track/album number/count, bitrating, rating, bpm */
  104.                 if(tags.get_uint(TAG_TRACK_NUMBER, out track))
  105.                     s.track = (int)track;
  106.                 if(tags.get_uint(TAG_TRACK_COUNT, out track_count))
  107.                     s.track_count = track_count;
  108.                    
  109.                 if(tags.get_uint(TAG_ALBUM_VOLUME_NUMBER, out album_number))
  110.                     s.album_number = album_number;
  111.                 if(tags.get_uint(TAG_ALBUM_VOLUME_COUNT, out album_count))
  112.                     s.album_count = album_count;
  113.                
  114.                 if(tags.get_uint(TAG_BITRATE, out bitrate))
  115.                     s.bitrate = (int)(bitrate/1000);
  116.                 if(tags.get_uint(TAG_USER_RATING, out rating))
  117.                     s.rating = (int)((rating > 0 && rating <= 5) ? rating : 0);
  118.                 if(tags.get_double(TAG_BEATS_PER_MINUTE, out bpm))
  119.                     s.bpm = (int)bpm;
  120.                
  121.                 if(info.get_audio_streams().length() > 0)
  122.                     s.samplerate = info.get_audio_streams().nth_data(0).get_sample_rate();
  123.                
  124.                 /* get length */
  125.                 s.length = info.get_duration()/1000000000;
  126.                
  127.                 s.date_added = (int)time_t();
  128.                 stdout.printf("g\n");
  129.                 /* get the size and convert to MB */
  130.                 s.file_size = (int)(file.query_info("*", FileQueryInfoFlags.NONE).get_size()/1000000);
  131.                
  132.             }
  133.             finally {
  134.                 if(s.title == null || s.title == "") {
  135.                     string[] paths = file.get_path().split("/", 0);
  136.                     s.title = paths[paths.length - 1];
  137.                 }
  138.                 if(s.artist == null || s.artist == "") s.artist = "Unknown";
  139.             }
  140.         }
  141.         else {
  142.             return null;
  143.         }
  144.        
  145.         return s;
  146.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement