def get_media_stream(streams):
    """Returns the metadata for the media stream in an MXF file,
    discarding data streams."""
    found = None
    for stream in streams:
        # skip 'data' streams that provide info about related mxf files
        if stream['codec_type'] == 'data':
            continue
        if found:
            raise UserWarning('Expected only one media stream per MXF.')
        found = stream
    return found