Web lists-archives.org

[MPlayer-dev-eng] [PATCHS] add some -identify messages with cddb://




Hi,

These patchs add some -identify messages with CDDB.
First, a message to retrieve DiscID. Second, some messages
to retrieve useful informations from cdinfo.

Okay, that is possible to parse the output given by cdinfo
but IMHO, here is a good place for -identify.

And some informations are "redundant" with ID_CDDA_* but
I've not always the same number of tracks (I've a bug
or anything else with recv() in http_read_response()
stream/http.c) and the MSF change a little bit.


PS: for the bug, I delete the file .cddb/discid and I use
cddb://. Sometimes the result is complete and sometimes
the result is truncated at 1142 bytes (*always* this value).
I don't know why but I will compile MPlayer on an other
system.. I'm not sure if the problem is related to MPlayer
or not.


Regards,
--
Mathieu SCHROETER
Index: stream/stream_cddb.c
===================================================================
--- stream/stream_cddb.c	(révision 27185)
+++ stream/stream_cddb.c	(copie de travail)
@@ -719,6 +719,8 @@
 	cddb_data.disc_id = cddb_discid(cddb_data.tracks);
 	cddb_data.anonymous = 1;	// Don't send user info by default
 
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_DISCID=%08lx\n", cddb_data.disc_id);
+
 	// Check if there is a CD in the drive
 	// FIXME: That's not really a good way to check
 	if( cddb_data.disc_id==0 ) {
Index: stream/cdinfo.c
===================================================================
--- stream/cdinfo.c	(révision 27185)
+++ stream/cdinfo.c	(copie de travail)
@@ -124,9 +124,18 @@
 	mp_msg(MSGT_DEMUX, MSGL_INFO, " genre=[%s]\n", cd_info->genre);
 	mp_msg(MSGT_DEMUX, MSGL_INFO, " nb_tracks=%d\n", cd_info->nb_tracks);
 	mp_msg(MSGT_DEMUX, MSGL_INFO, " length= %2d:%02d.%02d\n", cd_info->min, cd_info->sec, cd_info->msec);
+
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_ARTIST=%s\n", cd_info->artist);
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_ALBUM=%s\n", cd_info->album);
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_GENRE=%s\n", cd_info->genre);
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_LENGTH_MSF=%02d:%02d.%02d\n", cd_info->min, cd_info->sec, cd_info->msec);
+	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_TRACKS=%d\n", cd_info->nb_tracks);
+
 	current_track = cd_info->first;
 	while( current_track!=NULL ) {
 		mp_msg(MSGT_DEMUX, MSGL_INFO, "  #%2d %2d:%02d.%02d @ %7ld\t[%s] \n", current_track->track_nb, current_track->min, current_track->sec, current_track->msec, current_track->frame_begin, current_track->name);
+		mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_TRACK_%d_NAME=%s\n", current_track->track_nb, current_track->name);
+		mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CDDB_INFO_TRACK_%d_MSF=%02d:%02d.%02d\n", current_track->track_nb, current_track->min, current_track->sec, current_track->msec);
 		current_track = current_track->next;
 	}
 	mp_msg(MSGT_DEMUX, MSGL_INFO, "================ CD INFO ===  end  =========\n");
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng