[xiph-cvs] cvs commit: vorbis-tools/ogg123 http_transport.c Makefile.am callbacks.c callbacks.h ogg123.c status.c status.h transport.c

Stan Seibert volsung at xiph.org
Thu Dec 13 21:45:17 PST 2001



volsung     01/12/13 21:45:16

  Modified:    ogg123   Tag: volsung_kc_20011011 Makefile.am callbacks.c
                        callbacks.h ogg123.c status.c status.h transport.c
  Added:       ogg123   Tag: volsung_kc_20011011 http_transport.c
  Log:
  Preliminary http streaming is now back in ogg123.  Stats now do sane
  things with streaming sources.  Still a few niggly problems with the time
  display.

Revision  Changes    Path
No                   revision

No                   revision

1.14.2.4.2.4 +2 -1      vorbis-tools/ogg123/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.14.2.4.2.3
retrieving revision 1.14.2.4.2.4
diff -u -r1.14.2.4.2.3 -r1.14.2.4.2.4
--- Makefile.am	2001/12/11 18:46:22	1.14.2.4.2.3
+++ Makefile.am	2001/12/14 05:45:14	1.14.2.4.2.4
@@ -15,7 +15,8 @@
 
 ogg123_SOURCES = audio.c buffer.c callbacks.c \
                  cfgfile_options.c cmdline_options.c \
-                 file_transport.c format.c getopt.c getopt1.c         \
+                 file_transport.c format.c http_transport.c getopt.c \
+                 getopt1.c         \
                  ogg123.c oggvorbis_format.c status.c transport.c     \
                  audio.h buffer.h callbacks.h \
                  cfgfile_options.h cmdline_options.h \

1.1.2.4   +5 -5      vorbis-tools/ogg123/Attic/callbacks.c

Index: callbacks.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/callbacks.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- callbacks.c	2001/12/13 16:20:17	1.1.2.3
+++ callbacks.c	2001/12/14 05:45:14	1.1.2.4
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: callbacks.c,v 1.1.2.3 2001/12/13 16:20:17 volsung Exp $
+ last mod: $Id: callbacks.c,v 1.1.2.4 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -151,10 +151,10 @@
 
   status_print_statistics(stats_arg->stat_format,
                           buffer_stats,
-			  stats_arg->transport_statistics,
+			  stats_arg->data_source_statistics,
                           stats_arg->decoder_statistics);
 
-  free(stats_arg->transport_statistics);
+  free(stats_arg->data_source_statistics);
   free(stats_arg->decoder_statistics);
   free(stats_arg);
 }
@@ -162,7 +162,7 @@
 
 print_statistics_arg_t *new_print_statistics_arg (
                                stat_format_t *stat_format,
-			       data_source_stats_t *transport_statistics,
+			       data_source_stats_t *data_source_statistics,
                                decoder_stats_t *decoder_statistics)
 {
   print_statistics_arg_t *arg;
@@ -173,7 +173,7 @@
   }  
   
   arg->stat_format = stat_format;
-  arg->transport_statistics = transport_statistics;
+  arg->data_source_statistics = data_source_statistics;
   arg->decoder_statistics = decoder_statistics;
 
   return arg;

1.1.2.3   +3 -3      vorbis-tools/ogg123/Attic/callbacks.h

Index: callbacks.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/callbacks.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- callbacks.h	2001/12/13 16:20:17	1.1.2.2
+++ callbacks.h	2001/12/14 05:45:14	1.1.2.3
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: callbacks.h,v 1.1.2.2 2001/12/13 16:20:17 volsung Exp $
+ last mod: $Id: callbacks.h,v 1.1.2.3 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -48,14 +48,14 @@
 
 typedef struct print_statistics_arg_t {
   stat_format_t *stat_format;
-  data_source_stats_t *transport_statistics;
+  data_source_stats_t *data_source_statistics;
   decoder_stats_t *decoder_statistics;
 } print_statistics_arg_t;
 
 void print_statistics_action (buf_t *buf, void *arg);
 print_statistics_arg_t *new_print_statistics_arg (
                                stat_format_t *stat_format,
-			       data_source_stats_t *transport_statistics,
+			       data_source_stats_t *data_source_statistics,
                                decoder_stats_t *decoder_statistics);
 
 

1.39.2.30.2.20 +15 -1     vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.39.2.30.2.19
retrieving revision 1.39.2.30.2.20
diff -u -r1.39.2.30.2.19 -r1.39.2.30.2.20
--- ogg123.c	2001/12/13 16:20:17	1.39.2.30.2.19
+++ ogg123.c	2001/12/14 05:45:14	1.39.2.30.2.20
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.39.2.30.2.19 2001/12/13 16:20:17 volsung Exp $
+ last mod: $Id: ogg123.c,v 1.39.2.30.2.20 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -193,6 +193,20 @@
   pstats_arg = new_print_statistics_arg(stat_format,
                                         source->transport->statistics(source),
                                         decoder->format->statistics(decoder));
+
+  /* Disable/Enable statistics as needed */
+
+  if (pstats_arg->decoder_statistics->total_time <
+      pstats_arg->decoder_statistics->current_time) {
+    stat_format[2].enabled = 0;  /* Remaining playback time */
+    stat_format[3].enabled = 0;  /* Total playback time */
+  }
+
+  if (pstats_arg->data_source_statistics->input_buffer_used) {
+    stat_format[6].enabled = 1;  /* Input buffer fill % */
+    stat_format[7].enabled = 1;  /* Input buffer state  */
+  }
+
   if (audio_buffer) {
     /* Place a status update into the buffer */
     buffer_append_action_at_end(audio_buffer,

1.1.2.7.2.8 +1 -33     vorbis-tools/ogg123/Attic/status.c

Index: status.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/status.c,v
retrieving revision 1.1.2.7.2.7
retrieving revision 1.1.2.7.2.8
diff -u -r1.1.2.7.2.7 -r1.1.2.7.2.8
--- status.c	2001/12/12 15:52:25	1.1.2.7.2.7
+++ status.c	2001/12/14 05:45:14	1.1.2.7.2.8
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: status.c,v 1.1.2.7.2.7 2001/12/12 15:52:25 volsung Exp $
+ last mod: $Id: status.c,v 1.1.2.7.2.8 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -65,38 +65,6 @@
 
   return sprintf (dest, "%02li:%05.2f", min, sec);
 }
-
-#if 0
-void SetTime (stat_format_t stats[], ogg_int64_t sample)
-{
-  double CurTime = (double) sample / (double) Options.outputOpts.rate;
-  long c_min = (long) CurTime / (long) 60;
-  double c_sec = CurTime - 60.0f * c_min;
-  long r_min, t_min;
-  double r_sec, t_sec;
-
-  if (stats[2].enabled && Options.inputOpts.seekable) {
-    if (sample > Options.inputOpts.totalSamples) {
-      /* file probably grew while playing; update total time */
-      Options.inputOpts.totalSamples = sample;
-      Options.inputOpts.totalTime = CurTime;
-      stats[3].arg.stringarg[0] = '\0';
-      r_min = 0;
-      r_sec = 0.0f;
-    } else {
-      r_min = (long) (Options.inputOpts.totalTime - CurTime) / (long) 60;
-      r_sec = ((double) Options.inputOpts.totalTime - CurTime) - 60.0f * (double) r_min;
-    }
-    sprintf (stats[2].arg.stringarg, "[%02li:%05.2f]", r_min, r_sec);
-    if (stats[3].arg.stringarg[0] == '\0') {
-      t_min = (long) Options.inputOpts.totalTime / (long) 60;
-      t_sec = Options.inputOpts.totalTime - 60.0f * t_min;
-      sprintf (stats[3].arg.stringarg, "%02li:%05.2f", t_min, t_sec);
-    }    
-  }
-  sprintf (stats[1].arg.stringarg, "%02li:%05.2f", c_min, c_sec);
-}
-#endif
 
 
 void clear_line (int len)

1.1.2.4.2.6 +2 -2      vorbis-tools/ogg123/Attic/status.h

Index: status.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/status.h,v
retrieving revision 1.1.2.4.2.5
retrieving revision 1.1.2.4.2.6
diff -u -r1.1.2.4.2.5 -r1.1.2.4.2.6
--- status.h	2001/12/11 18:46:23	1.1.2.4.2.5
+++ status.h	2001/12/14 05:45:14	1.1.2.4.2.6
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: status.h,v 1.1.2.4.2.5 2001/12/11 18:46:23 volsung Exp $
+ last mod: $Id: status.h,v 1.1.2.4.2.6 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -64,7 +64,7 @@
 void status_clear_line ();
 void status_print_statistics (stat_format_t *stats,
                               buffer_stats_t *audio_statistics,
-			      data_source_stats_t *transport_statistics,
+			      data_source_stats_t *data_source_statistics,
                               decoder_stats_t *decoder_statistics);
 void status_message (int verbosity, const char *fmt, ...);
 void vstatus_message (int verbosity, const char *fmt, va_list ap);

1.1.2.3   +3 -2      vorbis-tools/ogg123/Attic/transport.c

Index: transport.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/transport.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- transport.c	2001/12/11 05:29:09	1.1.2.2
+++ transport.c	2001/12/14 05:45:14	1.1.2.3
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: transport.c,v 1.1.2.2 2001/12/11 05:29:09 volsung Exp $
+ last mod: $Id: transport.c,v 1.1.2.3 2001/12/14 05:45:14 volsung Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,9 @@
 #include "transport.h"
 
 extern transport_t file_transport;
+extern transport_t http_transport;
 
-transport_t *transports[] = { &file_transport, NULL };
+transport_t *transports[] = { &http_transport, &file_transport, NULL };
 
 
 transport_t *get_transport_by_name (char *name)

No                   revision

No                   revision

1.1.2.1   +281 -0    vorbis-tools/ogg123/Attic/http_transport.c

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list