]> git.sesse.net Git - ffmpeg/blobdiff - ffplay.c
10l for myself, fixing --disable-encoders
[ffmpeg] / ffplay.c
index 4fa5511ac329189d46adf692025b76e8c3810280..ecf2c5be396ac085979a2f6343715955721537c3 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -739,7 +739,7 @@ static void video_image_display(VideoState *is)
             is->no_background = 0;
         }
         rect.x = is->xleft + x;
-        rect.y = is->xleft + y;
+        rect.y = is->ytop  + y;
         rect.w = width;
         rect.h = height;
         SDL_DisplayYUVOverlay(vp->bmp, &rect);
@@ -1547,7 +1547,7 @@ static int synchronize_audio(VideoState *is, short *samples,
 }
 
 /* decode one audio frame and returns its uncompressed size */
-static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, double *pts_ptr)
+static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, int buf_size, double *pts_ptr)
 {
     AVPacket *pkt = &is->audio_pkt;
     int n, len1, data_size;
@@ -1556,7 +1556,8 @@ static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, double *pts_pt
     for(;;) {
         /* NOTE: the audio packet can contain several frames */
         while (is->audio_pkt_size > 0) {
-            len1 = avcodec_decode_audio(is->audio_st->codec,
+            data_size = buf_size;
+            len1 = avcodec_decode_audio2(is->audio_st->codec,
                                         (int16_t *)audio_buf, &data_size,
                                         is->audio_pkt_data, is->audio_pkt_size);
             if (len1 < 0) {
@@ -1617,7 +1618,7 @@ static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, double *pts_pt
    cannot have a precise information */
 static int audio_write_get_buf_size(VideoState *is)
 {
-    return is->audio_hw_buf_size - is->audio_buf_index;
+    return is->audio_buf_size - is->audio_buf_index;
 }
 
 
@@ -1632,7 +1633,7 @@ void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
 
     while (len > 0) {
         if (is->audio_buf_index >= is->audio_buf_size) {
-           audio_size = audio_decode_frame(is, is->audio_buf, &pts);
+           audio_size = audio_decode_frame(is, is->audio_buf, sizeof(is->audio_buf), &pts);
            if (audio_size < 0) {
                 /* if error, just output silence */
                is->audio_buf_size = 1024;
@@ -1703,10 +1704,8 @@ static int stream_component_open(VideoState *is, int stream_index)
     if (!codec ||
         avcodec_open(enc, codec) < 0)
         return -1;
-#if defined(HAVE_THREADS)
     if(thread_count>1)
         avcodec_thread_init(enc, thread_count);
-#endif
     enc->thread_count= thread_count;
     switch(enc->codec_type) {
     case CODEC_TYPE_AUDIO:
@@ -2341,7 +2340,7 @@ static void event_loop(void)
 
 static void opt_frame_size(const char *arg)
 {
-    if (parse_image_size(&screen_width, &screen_height, arg) < 0) {
+    if (parse_image_size(&frame_width, &frame_height, arg) < 0) {
         fprintf(stderr, "Incorrect frame size\n");
         exit(1);
     }