changeset 23010:74efb0fa8a0b

with -identify show audio and video id; patch by Andrew Savchenko (Bircoph list ru)
author nicodvb
date Fri, 20 Apr 2007 21:49:49 +0000
parents 41d042563508
children 365eef1fc4f0
files help/help_mp-en.h libmpdemux/asfheader.c libmpdemux/aviheader.c libmpdemux/demux_lavf.c libmpdemux/demux_mov.c libmpdemux/demux_nut.c libmpdemux/demux_real.c
diffstat 7 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Fri Apr 20 18:57:09 2007 +0000
+++ b/help/help_mp-en.h	Fri Apr 20 21:49:49 2007 +0000
@@ -634,6 +634,10 @@
 #define MSGTR_NoBindFound "No bind found for key '%s'."
 #define MSGTR_FailedToOpen "Failed to open %s.\n"
 
+#define MSGTR_VideoID "[%s] Video stream found, -vid %d\n"
+#define MSGTR_AudioID "[%s] Audio stream found, -aid %d\n"
+#define MSGTR_SubtitleID "[%s] Subtitle stream found, -sid %d\n"
+
 // dec_video.c & dec_audio.c:
 #define MSGTR_CantOpenCodec "Could not open codec.\n"
 #define MSGTR_CantCloseCodec "Could not close codec.\n"
--- a/libmpdemux/asfheader.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/asfheader.c	Fri Apr 20 21:49:49 2007 +0000
@@ -417,6 +417,7 @@
       audio_pos += 64; //16+16+4+4+4+16+4;
       buffer = &hdr[audio_pos];
       sh_audio=new_sh_audio(demuxer,streamh->stream_no & 0x7F);
+      mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "asfheader", streamh->stream_no & 0x7F);
       ++audio_streams;
       if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &audio_pos, &buffer, hdr, hdr_len))
         goto len_err_out;
@@ -451,6 +452,7 @@
     switch(ASF_LOAD_GUID_PREFIX(streamh->type)){
       case ASF_GUID_PREFIX_audio_stream: {
         sh_audio_t* sh_audio=new_sh_audio(demuxer,streamh->stream_no & 0x7F);
+        mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "asfheader", streamh->stream_no & 0x7F);
         ++audio_streams;
         if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &pos, &buffer, hdr, hdr_len))
           goto len_err_out;
@@ -459,6 +461,7 @@
         }
       case ASF_GUID_PREFIX_video_stream: {
         sh_video_t* sh_video=new_sh_video(demuxer,streamh->stream_no & 0x7F);
+        mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "asfheader", streamh->stream_no & 0x7F);
         unsigned int len=streamh->type_size-(4+4+1+2);
         float asp_ratio;
 	++video_streams;
--- a/libmpdemux/aviheader.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/aviheader.c	Fri Apr 20 21:49:49 2007 +0000
@@ -192,11 +192,13 @@
       ++stream_id;
       if(h.fccType==streamtypeVIDEO){
         sh_video=new_sh_video(demuxer,stream_id);
+        mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "aviheader", stream_id);
         memcpy(&sh_video->video,&h,sizeof(h));
         sh_video->stream_delay = (float)sh_video->video.dwStart * sh_video->video.dwScale/sh_video->video.dwRate;
       } else
       if(h.fccType==streamtypeAUDIO){
         sh_audio=new_sh_audio(demuxer,stream_id);
+        mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "aviheader", stream_id);
         memcpy(&sh_audio->audio,&h,sizeof(h));
         sh_audio->stream_delay = (float)sh_audio->audio.dwStart * sh_audio->audio.dwScale/sh_audio->audio.dwRate;
       }
--- a/libmpdemux/demux_lavf.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/demux_lavf.c	Fri Apr 20 21:49:49 2007 +0000
@@ -23,7 +23,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
-// #include "help_mp.h"
+#include "help_mp.h"
 
 #include "stream/stream.h"
 #include "demuxer.h"
@@ -305,6 +305,7 @@
             if(priv->audio_streams >= MAX_A_STREAMS)
                 break;
             sh_audio=new_sh_audio(demuxer, i);
+            mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "lavf", i);
             if(!sh_audio)
                 break;
             priv->astreams[priv->audio_streams] = i;
@@ -379,6 +380,7 @@
             if(priv->video_streams >= MAX_V_STREAMS)
                 break;
             sh_video=new_sh_video(demuxer, i);
+            mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "lavf", i);
             if(!sh_video) break;
             priv->vstreams[priv->video_streams] = i;
             priv->video_streams++;
--- a/libmpdemux/demux_mov.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/demux_mov.c	Fri Apr 20 21:49:49 2007 +0000
@@ -659,6 +659,7 @@
 		int version, adjust;
 		int is_vorbis = 0;
 		sh_audio_t* sh=new_sh_audio(demuxer,priv->track_db);
+		mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "mov", priv->track_db);
 		sh->format=trak->fourcc;
 
 		// crude audio delay from editlist0 hack ::atm
@@ -982,6 +983,7 @@
 		int hdr_ptr = 76;  // the byte just after depth
 		unsigned char *palette_map;
 		sh_video_t* sh=new_sh_video(demuxer,priv->track_db);
+		mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "mov", priv->track_db);
 		int depth;
 		sh->format=trak->fourcc;
 
@@ -1311,6 +1313,7 @@
 		    trak->fourcc == mmioFOURCC('t','x','3','g') ||
 		    trak->fourcc == mmioFOURCC('t','e','x','t')) {
 			sh_sub_t *sh = new_sh_sub(demuxer, priv->track_db);
+			mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_SubtitleID, "mov", priv->track_db);
 			if (trak->fourcc == mmioFOURCC('m','p','4','s'))
 				init_vobsub(sh, trak);
 			else
--- a/libmpdemux/demux_nut.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/demux_nut.c	Fri Apr 20 21:49:49 2007 +0000
@@ -100,6 +100,7 @@
 				calloc(sizeof(WAVEFORMATEX) +
 				              s[i].codec_specific_len, 1);
 			sh_audio_t* sh_audio = new_sh_audio(demuxer, i);
+			mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "nut", i);
 			int j;
 
 			sh_audio->wf= wf; sh_audio->ds = demuxer->audio;
@@ -135,6 +136,7 @@
 				calloc(sizeof(BITMAPINFOHEADER) +
 				              s[i].codec_specific_len, 1);
 			sh_video_t * sh_video = new_sh_video(demuxer, i);
+			mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "nut", i);
 			int j;
 
 			sh_video->bih = bih;
--- a/libmpdemux/demux_real.c	Fri Apr 20 18:57:09 2007 +0000
+++ b/libmpdemux/demux_real.c	Fri Apr 20 21:49:49 2007 +0000
@@ -1271,6 +1271,7 @@
 		} else {
 		    /* audio header */
 		    sh_audio_t *sh = new_sh_audio(demuxer, stream_id);
+		    mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "real", stream_id);
 		    char buf[128]; /* for codec name */
 		    int frame_size;
 		    int sub_packet_size;
@@ -1483,6 +1484,7 @@
 		}
 	  } else if (strstr(mimet,"X-MP3-draft-00")) {
 		    sh_audio_t *sh = new_sh_audio(demuxer, stream_id);
+    		    mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "real", stream_id);
 
 		    /* Emulate WAVEFORMATEX struct: */
 		    sh->wf = malloc(sizeof(WAVEFORMATEX));
@@ -1516,6 +1518,7 @@
 		} else {
 		    /* video header */
 		    sh_video_t *sh = new_sh_video(demuxer, stream_id);
+		    mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "real", stream_id);
 
 		    sh->format = stream_read_dword_le(demuxer->stream); /* fourcc */
 		    mp_msg(MSGT_DEMUX,MSGL_V,"video fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format);