[FFmpeg-devel] [PATCH 2/5] lavfi/avcodec: implement audio copy_frame_prop.

Nicolas George nicolas.george at normalesup.org
Thu May 3 20:02:50 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/avcodec.c |    7 +++++++
 1 file changed, 7 insertions(+)


Same as the one that was approved, except it uses
av_frame_get_sample_rate to access the field in src.


diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c
index e5f2bc3..850e21a 100644
--- a/libavfilter/avcodec.c
+++ b/libavfilter/avcodec.c
@@ -22,6 +22,7 @@
  */
 
 #include "avcodec.h"
+#include "libavutil/opt.h"
 
 int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
 {
@@ -38,6 +39,12 @@ int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
         dst->video->top_field_first     = src->top_field_first;
         dst->video->key_frame           = src->key_frame;
         dst->video->pict_type           = src->pict_type;
+        break;
+    case AVMEDIA_TYPE_AUDIO:
+        dst->audio->sample_rate         = av_frame_get_sample_rate(src);
+        break;
+    default:
+        return AVERROR(ENOSYS);
     }
 
     return 0;
-- 
1.7.10



More information about the ffmpeg-devel mailing list