changeset 3513:cfd3815774ad libavformat

Remove a dozen unused variables.
author michael
date Thu, 26 Jun 2008 22:28:58 +0000
parents 5a60e9f9f5d6
children 616ffabfbb5b
files psxstr.c
diffstat 1 files changed, 4 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/psxstr.c	Thu Jun 26 22:23:57 2008 +0000
+++ b/psxstr.c	Thu Jun 26 22:28:58 2008 +0000
@@ -50,20 +50,10 @@
 #define STR_MAGIC (0x80010160)
 
 typedef struct StrChannel {
-
-    int type;
-#define STR_AUDIO 0
-#define STR_VIDEO 1
-
     /* video parameters */
-    int width;
-    int height;
     int video_stream_index;
 
     /* audio parameters */
-    int sample_rate;
-    int channels;
-    int bits;
     int audio_stream_index;
 } StrChannel;
 
@@ -169,9 +159,6 @@
                 if (AV_RL32(&sector[0x18]) != STR_MAGIC)
                     break;
                 str->video_channel = channel;
-                str->channels[channel].type = STR_VIDEO;
-                str->channels[channel].width = AV_RL16(&sector[0x28]);
-                str->channels[channel].height = AV_RL16(&sector[0x2A]);
 
                 /* allocate a new AVStream */
                 st = av_new_stream(s, 0);
@@ -184,8 +171,8 @@
                 st->codec->codec_type = CODEC_TYPE_VIDEO;
                 st->codec->codec_id = CODEC_ID_MDEC;
                 st->codec->codec_tag = 0;  /* no fourcc */
-                st->codec->width = str->channels[channel].width;
-                st->codec->height = str->channels[channel].height;
+                st->codec->width      = AV_RL16(&sector[0x28]);
+                st->codec->height     = AV_RL16(&sector[0x2A]);
             }
             break;
 
@@ -194,19 +181,11 @@
             if (str->audio_channel == -1) {
                 int fmt;
                 str->audio_channel = channel;
-                str->channels[channel].type = STR_AUDIO;
-                str->channels[channel].channels =
-                    (sector[0x13] & 0x01) ? 2 : 1;
-                str->channels[channel].sample_rate =
-                    (sector[0x13] & 0x04) ? 18900 : 37800;
-                str->channels[channel].bits =
-                    (sector[0x13] & 0x10) ? 8 : 4;
 
                 /* allocate a new AVStream */
                 st = av_new_stream(s, 0);
                 if (!st)
                     return AVERROR(ENOMEM);
-                av_set_pts_info(st, 64, 128, str->channels[channel].sample_rate);
 
                 str->channels[channel].audio_stream_index = st->index;
 
@@ -218,6 +197,8 @@
                 st->codec->sample_rate = (fmt&4)?18900:37800;
             //    st->codec->bit_rate = 0; //FIXME;
                 st->codec->block_align = 128;
+
+                av_set_pts_info(st, 64, 128, st->codec->sample_rate);
             }
             break;
 
@@ -227,17 +208,6 @@
         }
     }
 
-if (str->video_channel != -1)
-  av_log (s, AV_LOG_DEBUG, " video channel = %d, %d x %d %d\n", str->video_channel,
-    str->channels[str->video_channel].width,
-    str->channels[str->video_channel].height,str->channels[str->video_channel].video_stream_index);
-if (str->audio_channel != -1)
-   av_log (s, AV_LOG_DEBUG, " audio channel = %d, %d Hz, %d channels, %d bits/sample %d\n",
-    str->audio_channel,
-    str->channels[str->audio_channel].sample_rate,
-    str->channels[str->audio_channel].channels,
-    str->channels[str->audio_channel].bits,str->channels[str->audio_channel].audio_stream_index);
-
     /* back to the start */
     url_fseek(pb, start, SEEK_SET);