Mercurial > mplayer.hg
comparison libmpdemux/demux_ogg.c @ 17977:f70772d02eaa
Convert printfs in aviprint.c to mp_msg and give the information printing
functions in this file a verbosity_level parameter.
author | diego |
---|---|
date | Mon, 27 Mar 2006 17:25:41 +0000 |
parents | 3fe3b2b3a6ce |
children | 4231482179b6 |
comparison
equal
deleted
inserted
replaced
17976:4c22d2209563 | 17977:f70772d02eaa |
---|---|
703 break; | 703 break; |
704 } | 704 } |
705 | 705 |
706 } | 706 } |
707 | 707 |
708 extern void print_wave_header(WAVEFORMATEX *h); | 708 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); |
709 extern void print_video_header(BITMAPINFOHEADER *h); | 709 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); |
710 | 710 |
711 /** \brief Return the number of subtitle tracks in the file. | 711 /** \brief Return the number of subtitle tracks in the file. |
712 | 712 |
713 \param demuxer The demuxer for which the number of subtitle tracks | 713 \param demuxer The demuxer for which the number of subtitle tracks |
714 should be returned. | 714 should be returned. |
991 ogg_d->num_sub, | 991 ogg_d->num_sub, |
992 (int)inf.version_major, | 992 (int)inf.version_major, |
993 (int)inf.version_minor, | 993 (int)inf.version_minor, |
994 (int)inf.version_subminor, | 994 (int)inf.version_subminor, |
995 n_video - 1); | 995 n_video - 1); |
996 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih); | 996 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V); |
997 } | 997 } |
998 # endif /* HAVE_OGGTHEORA */ | 998 # endif /* HAVE_OGGTHEORA */ |
999 # ifdef HAVE_FLAC | 999 # ifdef HAVE_FLAC |
1000 } else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) { | 1000 } else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) { |
1001 sh_a = new_sh_audio(demuxer,ogg_d->num_sub); | 1001 sh_a = new_sh_audio(demuxer,ogg_d->num_sub); |
1034 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video); | 1034 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video); |
1035 ogg_d->subs[ogg_d->num_sub].id = n_video; | 1035 ogg_d->subs[ogg_d->num_sub].id = n_video; |
1036 n_video++; | 1036 n_video++; |
1037 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n", | 1037 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n", |
1038 ogg_d->num_sub,pack.packet[68],pack.packet[69],pack.packet[70],pack.packet[71],n_video-1); | 1038 ogg_d->num_sub,pack.packet[68],pack.packet[69],pack.packet[70],pack.packet[71],n_video-1); |
1039 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih); | 1039 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V); |
1040 // Old audio header | 1040 // Old audio header |
1041 } else if(get_uint32(pack.packet+96) == 0x05589F81) { | 1041 } else if(get_uint32(pack.packet+96) == 0x05589F81) { |
1042 unsigned int extra_size; | 1042 unsigned int extra_size; |
1043 sh_a = new_sh_audio(demuxer,ogg_d->num_sub); | 1043 sh_a = new_sh_audio(demuxer,ogg_d->num_sub); |
1044 extra_size = get_uint16(pack.packet+140); | 1044 extra_size = get_uint16(pack.packet+140); |
1058 if (identify) | 1058 if (identify) |
1059 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio); | 1059 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio); |
1060 ogg_d->subs[ogg_d->num_sub].id = n_audio; | 1060 ogg_d->subs[ogg_d->num_sub].id = n_audio; |
1061 n_audio++; | 1061 n_audio++; |
1062 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1); | 1062 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1); |
1063 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf); | 1063 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf,MSGL_V); |
1064 } else | 1064 } else |
1065 mp_msg(MSGT_DEMUX,MSGL_WARN,"Ogg stream %d contains an old header but the header type is unknown\n",ogg_d->num_sub); | 1065 mp_msg(MSGT_DEMUX,MSGL_WARN,"Ogg stream %d contains an old header but the header type is unknown\n",ogg_d->num_sub); |
1066 | 1066 |
1067 // Check new header | 1067 // Check new header |
1068 } else if ( (*pack.packet & PACKET_TYPE_BITS ) == PACKET_TYPE_HEADER && | 1068 } else if ( (*pack.packet & PACKET_TYPE_BITS ) == PACKET_TYPE_HEADER && |
1090 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video); | 1090 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video); |
1091 ogg_d->subs[ogg_d->num_sub].id = n_video; | 1091 ogg_d->subs[ogg_d->num_sub].id = n_video; |
1092 n_video++; | 1092 n_video++; |
1093 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n", | 1093 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n", |
1094 ogg_d->num_sub,st->subtype[0],st->subtype[1],st->subtype[2],st->subtype[3],n_video-1); | 1094 ogg_d->num_sub,st->subtype[0],st->subtype[1],st->subtype[2],st->subtype[3],n_video-1); |
1095 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih); | 1095 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V); |
1096 /// New audio header | 1096 /// New audio header |
1097 } else if(strncmp(st->streamtype,"audio",5) == 0) { | 1097 } else if(strncmp(st->streamtype,"audio",5) == 0) { |
1098 char buffer[5]; | 1098 char buffer[5]; |
1099 unsigned int extra_size = get_uint32 (&st->size) - sizeof(stream_header); | 1099 unsigned int extra_size = get_uint32 (&st->size) - sizeof(stream_header); |
1100 unsigned int extra_offset = 0; | 1100 unsigned int extra_offset = 0; |
1129 if (identify) | 1129 if (identify) |
1130 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio); | 1130 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio); |
1131 ogg_d->subs[ogg_d->num_sub].id = n_audio; | 1131 ogg_d->subs[ogg_d->num_sub].id = n_audio; |
1132 n_audio++; | 1132 n_audio++; |
1133 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1); | 1133 mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1); |
1134 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf); | 1134 if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf,MSGL_V); |
1135 | 1135 |
1136 /// Check for text (subtitles) header | 1136 /// Check for text (subtitles) header |
1137 } else if (strncmp(st->streamtype, "text", 4) == 0) { | 1137 } else if (strncmp(st->streamtype, "text", 4) == 0) { |
1138 mp_msg(MSGT_DEMUX, MSGL_INFO, "[Ogg] stream %d: subtitles (SRT-like text subtitles), -sid %d\n", ogg_d->num_sub, ogg_d->n_text); | 1138 mp_msg(MSGT_DEMUX, MSGL_INFO, "[Ogg] stream %d: subtitles (SRT-like text subtitles), -sid %d\n", ogg_d->num_sub, ogg_d->n_text); |
1139 ogg_d->subs[ogg_d->num_sub].samplerate= get_uint64(&st->time_unit)/10; | 1139 ogg_d->subs[ogg_d->num_sub].samplerate= get_uint64(&st->time_unit)/10; |
1160 demux_stream_t* ds = NULL; | 1160 demux_stream_t* ds = NULL; |
1161 if(sh_a) { | 1161 if(sh_a) { |
1162 // If the audio stream is not defined we took the first one | 1162 // If the audio stream is not defined we took the first one |
1163 if(demuxer->audio->id == -1) { | 1163 if(demuxer->audio->id == -1) { |
1164 demuxer->audio->id = n_audio - 1; | 1164 demuxer->audio->id = n_audio - 1; |
1165 // if(sh_a->wf) print_wave_header(sh_a->wf); | 1165 // if(sh_a->wf) print_wave_header(sh_a->wf,MSGL_INFO); |
1166 } | 1166 } |
1167 /// Is it the stream we want | 1167 /// Is it the stream we want |
1168 if(demuxer->audio->id == (n_audio - 1)) { | 1168 if(demuxer->audio->id == (n_audio - 1)) { |
1169 demuxer->audio->sh = sh_a; | 1169 demuxer->audio->sh = sh_a; |
1170 sh_a->ds = demuxer->audio; | 1170 sh_a->ds = demuxer->audio; |
1174 } | 1174 } |
1175 if(sh_v) { | 1175 if(sh_v) { |
1176 /// Also for video | 1176 /// Also for video |
1177 if(demuxer->video->id == -1) { | 1177 if(demuxer->video->id == -1) { |
1178 demuxer->video->id = n_video - 1; | 1178 demuxer->video->id = n_video - 1; |
1179 // if(sh_v->bih) print_video_header(sh_v->bih); | 1179 // if(sh_v->bih) print_video_header(sh_v->bih,MSGL_INFO); |
1180 } | 1180 } |
1181 if(demuxer->video->id == (n_video - 1)) { | 1181 if(demuxer->video->id == (n_video - 1)) { |
1182 demuxer->video->sh = sh_v; | 1182 demuxer->video->sh = sh_v; |
1183 sh_v->ds = demuxer->video; | 1183 sh_v->ds = demuxer->video; |
1184 ds = demuxer->video; | 1184 ds = demuxer->video; |